SF has a lot of beautiful historic architecture, but also absolutely endless rows of bland, ugly, and tightly packed 2-story houses ("houses"). You could build over a quarter of the city and lose nothing.
A quick Zillow perusal showing 2BRs going for around $3.5-4k per month would seem to suggest that plenty of people are willing to live there (not me though).
Sadly, these are multi-family homes in a single family home. It's a lot of 7-8 people (multi-generation) families under one roof. Not stereotyping, that's the demographic. It's also why you get a lot of growhouses and brothels out there. Immigrant families almost never call the police.
That's why it's mostly brothels and growhouses (exaggeration).