It’s a level of friction that discourages the worst behaviors.
You probably lock the front door of your house. The reality is, it’s not a meaningful thing in most cases, as a moderately in shape middle aged man, I could likely kick or pry it in in seconds.
We do it because it keeps honest people out and increases the friction for the bad guys - kicking the door down in itself becomes a felony. (Burglary)
Likewise, people are on a bell curve of sorts with respect to motivation. The people on the bottom are a waste of oxygen and require explicit directions for every task, and the other extreme are self-motivated and will create novel tasks to complete without any direction.
Some people need the office to function appropriately on that curve. I have one guy on my team who came to work physically every day during the full lockdowns in NYC because for him, the context shift of being in the office was important. He is probably the smartest person I’ve ever met, but he can’t work at home. Another colleague is living on an island somewhere.
The rest of us are in the middle. Combine that with other business requirements, and you have to make a decision that’s best for the business.