Seattle and NYC can also easily reach that.
Source: I'm in Seattle making 210k 3 years out of college.
If more high-density housing was built, then rents would fall, middle-income people could live here again, and tech workers could pocket their fat salaries as savings (or live extremely lavish lifestyles). They would still be paid a lot, because there'd always be another tech company around the corner willing to bid up wages to their current level. For the salary "bubble" to pop, a lot of these companies would have to go out of business at once. This was exactly what happened in 2001 and 2009, and it had the predicted results: unemployment spiked, wages fell, rents fell, and people moved out of the Bay Area back to wherever they came from.
I think it's a dangerous attitude to think the salaries in CA are the actual worth of a software developer's work. It's just what FAANG can afford to pay. For many companies devs at that price point are not economically sustainable.
(Also, while there's some variance for cost-of-living in FAANG salaries in different regions, it's not that much. Google developers make less in Beijing than they do in Mountain View, but their salary still looks much more like a Google salary than a Beijing salary.)
I'll agree with you that if you work at a rando tech startup, the costs of living are going to be quite high, and make it probably not worth it.
But, the whole equation changes if you are working for a big 5 tech company, or hot unicorn company.
These companies will pay you double what the rando startups pay. Who really cares if you are paying 40k a year on rent, if your total compensation breaks 250K.
And getting 250k+ as an engineer, with a couple years experience, is only really possible in the Bay area.