The academic and military labs were definitely big factors. There's also:
- California doesn't enforce non-competes - which allows people to leave and form new companies. The "traitorous eight" are as much part of the founding mythos of SV as the acadmic/military labs. That is a regulatory decision.
- Founders and early employees get paid largely in stock or stock options, which are taxed less than salary. This provides them with capital to become angel investors in new companies and provide not only funding, but mentorship and connections. That's partly a consequence of the way capital is taxed. If you start taxing capital so that founders aren't left with enough to become investors, you'll break that feedback loop.
Why isn't Sweden a hellhole? They have higher taxes than many other EU localities, but have a more vibrant startup economy.
The artifact that created Silicon Valley was the University of California system, and the location of military and national labs, a nexus of government and academic R&D, with a ready and waiting STEM labor force. It was not because it was a tax and regulatory haven.