The only reason those perks exist is because of the unfathomable amounts of profit those companies make compared to others.
The fact that luxurious living wastes labour is not a plus for luxurious living. There are tons of things society could be doing with that labour that are more useful, they just don't get done because we allow pseudo-monopolies to retain too much rent.
The amount people care about free snacks is vastly out of proportion with the actual cost of providing free snacks. That’s great because young people making ~200k don’t really care much about slightly more gold plated health insurance coverage relative to how expensive it is.
It's also that the company can provide these things to all employees for less than it would cost for every individual employee to buy them by themselves.
On the other hand, if you're going to have a communal coffee machine, might as well have a bunch of other stuff and then pay dedicated staff to run it, for the convenience of everyone else.
Maybe it's copycatting of the college dorm startup vibe, too.
The company could not care less about employees paying more for those.
Hey, some FAANG offices require you to make your own coffee. I had to make my own espresso on one of the $5k+ espresso machines in the microkitchen. Of course, I'd do that after company-provided breakfast in the cafeteria. My cash compensation alone was what I imagined my total equity would be worth if my first startup "hit it big" and IPO'd.
I agree that it's totally unnecessary, and would cringe when people would complain about the quality of the coffee purchased for the machines, that office X got free laundry service and we didn't, or that it was lame that there was no free dinner on Friday nights.
When I started my career, some Hot Pockets in the freezer seemed like an extravagance. I want a decent pay, a clean work environment, IT infrastructure that isn't a burden, and to feel like I'm making a real impact. Beyond that, it's all gravy.