I'm more surprised by the fact that the tech industry chose SF of all the places in California.
Shockley was working at Bell Labs over in New Jersey on solid state electronics, and was jointly awarded the Noble Prize for the discovery of the transistor effect. When he moved back home, angry at how the invention of the transistor had been handled at Bell Labs, he took a number of researchers with him. Together they were one of the first startups in Stanford's new "Stanford Industrial Park", and the first to use silicon. Some of those researchers later started Fairchild Semiconductor, from which came many companies like Intel and AMD.
If you haven't heard of it yet, Stephen Fry has an excellent (if too brief!) podcast that goes through this and the history of other big advances in technology in great detail, called Stephen Fry's Great Leap Years.
The move to SF has been much more recent and mainly fueled by the desire of younger workers to live/work in more densely populated areas. And then most startups started basing out of SF proper to be closer to these workers (and appear “cool”) so now you have all the big startup successes based in the city proper.
Baltimore is cheap, but I want to live somewhere that I can ride my bike without the fear of getting killed for it.
You can seriously go on a little mini vacation every weekend for almost no money. I suppose if money were no object - why would you choose to live elsewhere?
Cool you like the west .. it's just too expensive and socialistic for me. Independent voter here.
Buying a house in PA on almost Silicon Valley (working remotely) salary you can buy two and other investments.
Those are two facets of the same issue which is a demand much higher than the supply. SF has one of the best tech scenes in the world (to the point where it becomes stomach-churningly nauseating), and it's also just a hip metropolitan city with other thriving non-tech scenes.