People want to live in SF because it's cool.
A lot of people who work at Facebook and Google would still rather live in SF and commute 2-3 hrs roundtrip each day rather than live in Menlo Park/Mountain View (or surrounding cities).
Tech companies are going to start where the talent is, and a bulk of that talent want to live in SF.