This is not illegal. I with 3-4 unrelated people in college from time to time. There was one group that rented a massive house and had 15-20 people living in it.
The SRO bans went explicitly against a form of "hotel" really which was more individualistic.
An example is seen in Blues Brothers, before Carrie Fischer remodels it; probably to install higher density.