It's a mix. California has at least some reasons for why it is a tech haven: non-competes unenforceable; well-supported state university system
California also gets a lot wrong that interferes with tech: prop 13 and friends, housing policy, incredible corruption, massive local conservatism
But California is most like America as a microcosm: horrifically corrupt but such a powerhouse that it resembles a leviathan that charges despite the parasites on its back and belly.