* No need to own car, or at least no need to drive everyday.
* For a spouse on a H-4 visa and who thus cannot work, living in the city makes things easier and a lot less boring.
* Mountain View / Sunnyvale / Palo Alto / ... have pretty sad downtown areas, they aren't bike/pedestrian friendly, and they make you live in purely residential areas.
So they end up spending $3~4000 on rent to live in SoMa and be close to their company shuttle lines or the Caltrain station. Some can work during the commute, some can't.
My friends in Berkeley have it better (much nicer residential areas, you can bike to your Bart station). But then of course you need a job in the city or in Oakland (and even though things have supposedly improved a lot, it still looked pretty sketchy to me).