SF had an abundance of jobs that paid a boat load of money, and people moved there to take those jobs.
Not because it's close to Muir Woods and has the best weather in the world, and the people at cafes wear cool t-shirts (although nearly everyone who moves to SF tries their hardest to convince themselves this is the real reason, not the job and the money).