The Bay Area is home to some major tech employers (Google, Apple, Oracle, Cisco, Salesforce, Intel, etc), and is also a major outpost for other big names (Microsoft, Samsung, Sony, etc). There are also a number of major employers in high-compensation jobs (finance, bio-tech, law). Even among startups, there is a big difference between a scrappy little company of three folks and a company like Uber.
Bottom line: there is lots of money floating around the Bay Area. As much as we might like to believe otherwise, the amount in small start-ups is just not that much.
viz mountain view authorizing some 2-5 million ft2 of office space for linkedin, et al, [1,2] and maybe adding a couple thousand homes [3]. Where are those thousands of new employees going to live? Not in Mountain View, pop 75k. So they have to get housing where there is housing available, and so lots of them will live in sf by necessity.
[1] http://www.mercurynews.com/business/ci_28058088/google-linke...
[2] http://www.bizjournals.com/sanjose/news/2015/05/06/in-stingi...
[3] http://www.mv-voice.com/news/2015/05/15/housing-dealt-setbac...