This is why it pays for companies like Apple to own their headquarters.
Overbuilding the HQ is a classic sign of hubris, similar to putting your name on a stadium. (Look to Lehman and Bear Stearns for the former, Enron and 3com for the latter)
(The main difference being that real estate can even increase in value, so it is an investment as much as a cost; whereas computers invariably depreciate to 0 in the end.)
A similar analogy is also around core competence - focus on what you are good at (software vs real estate). Bathe world is littered with monuments to companies that overbuilt or overpaid.
Regarding buy vs. rent, I think at the time it made sense, if they were planning on sticking around for 5+ years, given the price per square foot they paid and the fact that they would fill up the entire space.
[1] http://www.businessinsider.com/zynga-insiders-cashed-out-jus...