[1] Office space is expensive, but not that expensive relative to an engineer's salary. The going rate for class A space in Manhattan is about $70/square foot per year. That puts a 10x10 office (assuming 85% usable space) at about $8,000 per year + build-out + maintenance.
[2] Apple's new spaceship building (in the middle of a faceless suburb) will cost $5 billion and have 2.8 million square feet of space. One World Trade Center (in downtown Manhattan) will cost $3.9 billion and have over 3 million square feet of class A office space. A lower-profile project, the New York Times building in Midtown West, was constructed for $850 million and has 1.5 million square feet.
Apparently Google spent almost $2 billion on a squat 18-story structure in Manhattan with an over-abundance of depressing window-less interior spaces... I'm going to assume it was the difficulty of getting 2.9 million square feet in one place rather than just bad taste.
EDIT: I'm not saying Apple's offices are open plan. I have no idea what Apple's setup is. I'm pointing out that companies are certainly willing to spend a lot of money on these big suburban office parks, multiples of what it would cost to just buy a couple of skyscrapers in SF. Thus, cost does not seem to be the motivating factor (except maybe in a penny-wise pound-foolish sort of way).