Don't worry many towns have laws against roommates I am sure with conservation fascism taking a hold in the world that this will soon be against the law period.
They used to be called brothel laws. They're usually written as a limit to how many adults who aren't related can share an address.
https://www.freeadvice.com/legal/zoning-laws-on-unrelated-people-living-together-in-the-same-house/
https://www.floodlaw.net/landlords-beware-four-unrelated-persons-equal-a-rooming-house/
https://evanstonnow.com/three-unrelated-rule-is-a-barrier-to-housing-affordability/
I found these on “google” if you’ve ever checked that site out.
Ha. Thanks for doing my homework for me. I honestly don't know what my original sources were... I've been aware of the existence of "brothel laws" for ages. I lived in a large intentional community (read: commune, but avoiding sexual connotations at least in a US context) for a long time and running afoul of brothel laws in the past was something I learned about there.
Ah I see where the confusion is. The original article referenced Canada. The brothel laws you sourced look like they’re from the US
Funny but they have these affordable housing laws in the us and I know of at least on suburb whos answer was rescinding these type of laws. In in some ways their affordable housing solution was roommates.
Back at uni, the city had a house inspector of sorts that would go to each house and check to make sure there weren't more people living there than was legally allowed (Idk how they determined that). So if a house was registered to hold at most 4 residents, then legally you couldn't house more than 4 people there. So college students got around that by just not writing their name on the lease, and then just hiding their things, bed, etc to make it look like the legal amount lived there.