No office I've ever worked in had private spaces that were usable on a permanent basis by anyone other than senior management (who are thus oblivious to how the rest of their company actually spent their days). And I've been working since 1992.
Private offices, minimal monitoring, high pay, and lots of schedule autonomy, are perks of the higher tiers of management, and, more generally, are markers of upper-middle class norms in a work setting.
Letting programmers have all those things would cause a great deal of class distress among managers ("why, these middles and proles [Fussell's terms] are getting the same perks as me, their superior! Now how are we going to distinguish between those and the upper-middle, at work?") so they try to avoid the ones they can. High pay, can't do much about that (though they do their best); schedule autonomy, not universally available, but in general we do OK there, at least; they've had a fair amount of success keeping us under frequent monitoring that would be seen as an intolerable insult if applied to higher tiers of management ("Agile" has been a huge boon for them); and private offices, ooooh boy, offices, they've managed to all but eliminate them for us, and we helped with the same free-spirit fuck-traditional-office-norms hacker attitude that (on the flip side) also got us some of that schedule autonomy.
IOW we threaten their class security, if you will, and giving us private offices would be a big step in the wrong direction on that front, from their POV, especially since that's the one aspect of upper-middle work perks they've been the most successful at keeping us from accessing.
The "professional class" set of the Fussellian upper-middle has been under steady attack, with only lawyers mostly still hanging on (non-lawyers can't own law practices, is probably the only reason, or they'd be under the thumbs of MBAs and private equity just like doctors are these days) such that higher tiers of management are increasingly the only remaining large group (sans lawyers) who still enjoy an 80s-style upper-middle life at both work and home, and I think they'd like to keep it that way. The last thing they want is a whole bunch of software dorks "leveling up" a class, and becoming their social peers. It was bad enough when the '80s-and-earlier "analysts" were kinda-sorta upper-middle—luckily they nipped that in the bud by combining "analyst" and "programmer" and ensuring the new role tended to get only the latter's social status.
Early in my career, every dev had their own office with a door. That was unbelievably excellent both for people's general outlook and for the quality of work.
After that, it was years and years of cubes. That was less than ideal, but people made it work. Then open offices came into vogue. That was hated by the majority, and the quality (and speed) of work sorely suffered.
Perhaps the compromise position for RTO could be: you have to come to the office, but you get your own actual office.
This is something these companies, who are so eager to have people in the office, could easily change. With space so inexpensive and after the many layoffs, why not add more private offices for those who do come in?
The current push to return to office is because that was the way things were done before. It doesn't seem likely that THIS change would be on management would go with either.