I have been thinking A LOT about this recently. I've seen the surface reasons for why a company would oppose WFH but I don't really buy that as the entire reason. It's more than just about real estate, “face time”, or helping the new hires acclimate better.
The opposition to WFH is because WFH challenges the culture of fear that is used to keep workers working, underpaid, and stuck. It's like companies are mostly all indirectly in collusion with one another because they see and know the threat of working at home. It shifts the power that is almost entirely stacked at the feet of the employer over to the worker.
They don't care about productivity. They mostly care about the veneer of productivity with an actual prerogative of control and to a certain extent: demoralization. If you are demoralized you will more easily lose sight of your value and you will become complacent with that “competitive” wage. A demoralized you will also be less likely to try to rise up or rekindle any power or luxury you once had. You are less likely to challenge inequities in the workplace if you are demoralized.
Employers are waging a carefully worded battle against us. The real opposition to WFH I believe comes from the same visceral place within employers that oppose unionizing. The west, particularly the United States is extremely sick in terms of labor and cultural practices that underlay our labor practices and relationships with one another.