When the universities' reputations were established, SF dominated the Bay Area. Till suburbia spread down the peninsula in the 1950s, what we now call Silicon Valley was mostly agricultural land.
San Jose's population in 1940 was 69,000. SF's was 635,000.
Shockley did not come to the bay area for San Francisco, he came to be close to his ailing mother in Palo Alto. From Shockley Semiconductor came the traitorous eight and Fairchild and from this cluster came most of what we now know as silicon valley. Hewlett and Packard both came from Stanford, etc.
SF may have dominated the bay area for quote a while, but none of the seminal events that can be pointed to as the seeds of what became silicon valley have a very direct link to what you and everyone else seems to consider the San Francisco "culture." The marine geography that makes San Francisco a great anchorage and led to a strong naval presence in the area probably had a bigger impact on silicon valley than anything you can point to an as a uniquely "San Francisco" impact on the valley.
The critical moment in that story was not when Shockley moved back to the Bay Area, but when the traitorous eight decided they wanted to find a way to remain here, even though they couldn't stand working for Shockley anymore. Of the eight, I believe only Moore had family here. The rest wanted to stay simply because they liked it.
San Jose's population in 1940 was 69,000. SF's was 635,000.