The reasons why the Bay Area is the global capital of technology are absolutely totally unrelated to the quality of infrastructure or the policies of local government there.
It’s mainly due to the state of US technological advancement decades ago when the whole thing got started, the general US-level business-friendly environment, and the presence of an extremely prestigious (especially in science and tech fields) university nearby.
The specific reason is that William Shockley's mother lived in Palo Alto. Stanford gets the credit but in reality it had nothing to do with the decision.