This would be a much better list to sample randomly from than "go to a grocery store and test everyone who walks in".
I should point out on /r/nyc, some local redditors saw the testing going on all week in the same location and posted about it, informing others. I suspect this led people who wanted a free test to actively seek them out, especially because it's so hard to get tested otherwise. I'm pretty sure I had it over a month ago and I still haven't gotten tested, so if I'd seen those posts in time I'd have headed over there to get tested myself. Point is, the sample is even further biased because word spread around and some number of people getting tested there were actively seeking it out for reasons.
What huge legal issues? This is all the government. Of course it has lists of all of its citizens, and can and does use said lists.