First, sf and the valley simply don't pay engineers well enough. This is the second, striving to become the first, most expensive housing market in the united states. $150k sounds great here until you look at that as a fraction of your housing cost and compare to anywhere else in the country, including manhattan (because unlike here, nyc isn't run by morons so they have functioning transportation systems). I don't want to just quote myself, but all this still applies: https://news.ycombinator.com/item?id=7195118
Second, immigration is a crutch to get around paying domestic employees enough. I see net emigration from the valley amongst experienced engineers in their 30s who start having families and can find better financial lives elsewhere. If companies paid well enough that moving to the bay area wasn't horrid financially, they'd find plenty of software engineering talent already in the united states. But consider my friend above: $165 total income in the midwest is (compared solely to housing cost) equivalent to approx $450k here, when holding (housing costs / post tax income) constant.
edit: not to mention, companies still don't want flexible employment arrangements or remote work. I'm a data scientist and I'm good at my job (proof: employment history, employers haven't wanted me to leave, track record of accomplishments.) I'd rather live elsewhere. 66 data scientist posts on craigslist (obv w/ some duplication, but just a quick count) [1]; jobs that mention machine learning fill search results with > 100 answers [2]. Now check either of the above for telecommute or part time. Zero responses for remote or part time workers. So again, employers want their perfect employee -- skilled at his or her job, wants to move to the valley enough to take a big hit to net life living standards, doesn't have kids, and doesn't want them (cause daycare or a nanny or an SO who doesn't work is all very expensive.)
[1] http://sfbay.craigslist.org/search/jjj?zoomToPosting=&catAbb...
[2] http://sfbay.craigslist.org/search/jjj?zoomToPosting=&catAbb...