Ok, but not everyone can afford it. When there's a dearth of apartments and you can't afford your own detached house, you're forced to share a house with other people.
People do not prefer sharing a house with roommates to having their own apartment.
Also the idea that people's preferences should be encoded into bans on certain housing types is completely absurd to begin with.