As NYC receives influx of migrants, judge rules right to shelter for New Yorkers only