If only the market was working as you think it does. If you remove regulations getting in the way of building faster and denser, I bet you that San Francisco would see a construction boom and prices go down significantly over time. Prices are way up precisely because housing is no free market and we created a lot of barriers to new supply. The fact that so many people want to live here despite such crazy prices is a strong indication that there's a lot of demand to live in the city.