Lots of people who love the access to nature, the climate, etc. in the Bay Area would never move to NYC. And lots of people who consider anyplace that's not Manhattan to be a provincial hick town would never move to the Bay Area.
I'm closer to the second camp (though I live in Brooklyn).
Something a lot of people don't seem to realize is that there are a lot of very smart people working on trading apps for big banks on Wall Street that absolutely hate it. High Frequency Trading apps require a ton of programming talent, but a lot of the engineers who work on this stuff really dislike the bank atmosphere. When I worked at Jet.com, I had several coworkers who were substantially smarter than me, who actually took a paycut to work for Jet, simply because they hated the bank environment so much.
I think some of the tech companies know this fact, and feel that they can probably poach some of this talent by offering competitive salaries while having a more interesting atmosphere.
EDIT: DISCLAIMER
I work for one of these "primarily California companies expanding stuff to NYC".
I do, on the other hand, understand the attraction of the Bay Area given enough money although, in this case, the negative side of the balance sheet has gotten much longer and redder.
I agree with your basic point. Another reason I never seriously went after an investment banking job was that the sort of thing I was interested in was pretty much viewed as grunt stuff that techies did, i.e. not really respected.
(ADDED: I was using Manhattan as a term for the [nice uber-urbanized] parts generally although I know that's not accurate. I don't think I ever set foot in Brooklyn until relatively recently.)
Expanding their NYC office will allow Facebook to hire more of those engineers without lowering their hiring bar or further fragmenting campuses.