I have no knowledge of Tumblr's internal workings, but I would bet if you talked to the folks who used to be on that editorial team they'd have stories of their own budget being squeezed in trivial ways before the layoff. Laying people off is hard, managers don't like to do it, so they almost always look for other ways to save money before biting the bullet and canning people. And when management decides that a particular division isn't critical to the overall business, it's typical for the bean-counters to be unleashed on that division to look for "economies" that other divisions more beloved by management don't have to bear.
Since the process of layoffs generally involves a rank-and-yank, the people who remain are precisely the ones who have the option of working elsewhere. They can generally (depending on the location) get an offer within a day.
Companies just see an easy line item savings without thinking of the impact on the employees they desperately need to hold onto. On top of any potential insult to the employees, the companies that do this are giving off a terrible impression. "OMG. They can't even afford free soda anymore. This ship is definitely sinking."
Coffee - not as familiar with the economics of coffee, but of course dedicated machines will end up costing somewhat less than going directly to starbucks.
And most Cokes in a convenience store are now $1.50 or more, at least where I live.
Take, for example, Tumblr, which right now is a pretty big success. Just a month ago, they laid off their entire editorial team. Who knows if it was at all related to the Yahoo purchase, or if it was a decision made because Tumblr really need to cut expenses? But sometimes companies change course and cut because of ostensibly responsible financial concerns.
In the case when an exciting company has to trim (but not just die), how should it handle the case of having a fancy coffee machine and possibly saving a job? It seems it would be a bit awkward if the company laid people off but kept all of its original ostentatious perks.