There is a field called economic geography that works to explain your question. It's too complex to summarize, but the short version is that SV has lots of startups, lots of investors, and lots of hackers in a small space, so people who want to do those things move there, creating a cycle.
See also http://paulgraham.com/maybe.html, http://paulgraham.com/cities.html, http://paulgraham.com/hubs.html.