A New York judge blocked the state's retail marijuana licensing program on Friday, dealing a devastating blow to the fledgling marketplace after a group of veterans sued over rules that allowed people with drug convictions to open the first dispensaries.