It's exactly this, 1000%. I work for a small company that had a return-to-office mandate a few years ago when Covid began initially winding down as access to vaccines became widespread. I was working fully remote and had leased an apartment over an hour away from the closest branch office in an affordable part of town. We had our most profitable year ever in the nearly 50 year history of the company in 2020 when literally every employee was working remote. Morale was up, I was saving money that wasn't going to gas or car maintenance, and I was feeling positive about the future of work-life balance.
Then, one day, I get called in for performance review, and it was all smiles and sunshine and then they said "You're doing a great job Furbag, but we'd like to see you back in the office for a minimum of three days per week." That was the first and only negative comment I had ever received on a performance review since starting for the company. When I escalated the results of my performance review to management, wanting a more clear explanation for why I am being asked to commute 1+ hours in to work almost every day from the outskirts of the bay area, they told me exactly what you said "We're paying for this building, so we want people physically in the office to justify it. Also, every other industry is doing return to work mandates so this shouldn't come as a surprise to anyone."
Naturally, this is still a sore spot for me. The company didn't learn it's lesson and still follows industry trends like little lemmings (and not the good kind that post here) while looking into buying up more real estate in other parts of the state to expand operations. They could be selling the building I'm working in now, and use the profits from the sale to fund everybody with equipment to work from home (desk, chair, monitors, hardware, etc) and work would continue as usual with a lot more employee satisfaction and work-life balance, but I've learned that owning real estate as a business is in itself a prestige that the C-Suite loves to show off to it's competitors. "Look at this historic building we own, isn't it grand?", "Oh, you think that's grand? We rent 12 floors of a 40 story skyscraper in San Francisco, beat that!".
Managers need the physical locations to continue to exist so that they can justify their own existence, and they've fully convinced gullible CEOs that productivity will wane if people are allowed to do work from home "unsupervised", even though there's plenty of data that suggests the opposite is true.
/endrant