Why the Bay Area? Because it has a huge collection of both jobs and employees. As an employee you have lots of options should things fall through with your current employer, and as an employer there is lots of talent you could potentially hire (though for a high price). No reason it had to be the Bay Area in particular, but it had to be somewhere.
If it moves somewhere else, it's likely that place's real estate market would be similarly inflated by an influx of professionals.
Some people (pretty much everyone who is vocal about this on HN) see remote work as the solution. I'm skeptical - it takes a lot to make your issue tracker, documentation, mailing lists etc. thorough enough that they're the only communication developers need. In my experience (and I expect at many companies) developers come across crucial bits of information through serendipitously overheard conversations, or by wandering over to people's desks, etc. such that if structured (i.e. either async or scheduled) communication were the only communication, things wouldn't get done as well or as quickly.
I'm not sure the former is good for me as an engineer. It'd be nice to afford a decent house, but less so if I have to sell it and move cross country to advance my career or flee an employer going the way of Yahoo. Barriers like geography, moving costs, social ties in different cities keeping the best employer-employee pairs from finding each other are a form of inefficiency that I'm not sure we should seek to introduce.
I'd like the latter - we could build it somewhere more development-friendly, which would make it less insane than the Bay Area housing market, but putting a huge industry of well-paid professionals somewhere isn't compatible with low cost of living (see: Manhattan, DC).
And seriously that zone along the coast range up the peninsula is a really sweet spot[1]. If you and your associates have to be somewhere it's really hard to beat. (not so nice for the middle class couple trying to buy a house where the schools are still good, or the guy commuting from Tracy)
[1] Los Gatos all the way up to Woodside. Also check out Danville CA on the other side of the Oakland Hills.
There's an excellent video on him around, I'll see if I can't turn that up. Here: "The Secret History of Silicon Valley", tech talk at Google: https://m.youtube.com/watch?v=hFSPHfZQpIQ
Briefly:
UC Berkely and Stanford, each of which had (and have) excellent engineering deparments. Other colleges, universities, junior colleges, and public schools were from the 1950s through 1970s excellent. Most have been faltering since the 1980s.
Moffet Airfield. Already established by WWI and home to airship activity.
World War II. An immense industrial capacity built up, many defense industries, and a nascent technology cluster.
Amazing weather. There's little else in the US, or anywhere in the world, which can compete.
(For all the specific local boosters out there: I didn't say no places, I said "little else".)
Cheap housing. Up through the 1970s, California had ample room to grow, and things didn't start getting particularly nuts until the 1980s and 1990s. Since 1995, it's simply been insane.
Freeways. For a time it was possible to get around. That's no longer particularly the case. BART helps. Caltrain doesn't hurt too much. Both are entirely inadequate.
The ability to work from anywhere is only about 10 years old. The need for tech industry is closer to 50-60 years old, and local efficiencies, economies of scale, job-mobility, etc., all happen and matter.
If engineers are purely sitting at their computers and not talking to each other at all (except during scheduled meetings), the team could probably be converted to remote without downside, but plenty of organizations have an implicit dependency on unstructured conversation, and while there are ways to facilitate that in a remote work environment, it's not obvious.
Tldr; early internet infrastructure