Silicon Valley literally started thanks to US Navy and later general DoD funding, which brought more companies interested in local integration of services (even if you weren't taking government contracts, your clients might be, etc.) and this spiralled up
I think that large part of the reason is that government, public companies, academia and private investors in US have funneled a lot of resources into tech, or even invented it.
This created an ecosystem the rest of the world has consistently had a hard time to follow.