A proper office can be more pleasant than your home office, but most of them are not that great, e.g. you rarely have a quiet place focused on work, instead it is a noisy shared space. The business people say it is because of improving collaboration, but a lot of it is due to cost.
There is certainly value in being able to have face to face meetings, low overhead processes such as daily standups and pair programming, and build relationships with co-workers over lunch.
The biggest value in working from home is that you can fit work into the rest of your life, e.g. taking care of kids and reducing costs. Making people come into the office one or two days a week breaks that value.
The challenge of remote work moving forward is to try to build processes to reduce friction in online collaboration and to explicitly give space for team building and personal aspects.