A federal court in New Jersey upheld the constitutionality of a city ordinance that restricts private property owners’ use of residential properties as short-term rentals.