This is about Health, Safety and Welfare...not a property search. The judge is wrong.
I could be wrong, and of course the media buried the actual point, but I think the landlords objection was that was compelled by NYS law to accept the vouchers in the first place.