My employer tried a mandatory work-from-home policy back in the early 2000s. They'd tried pilot programs at some sites, and discovered both productivity and employee happiness increased by about 10%. So they rolled it out to all the sites, unilaterally, and we had to get at least 20% of the people on site working from home.
The issue is that the test programs were in high-density urban environments. People had long, stressful commutes in heavy traffic. Of course people enjoyed a break from that!
Our site was in a town of 10,000 people. Many of our employees lived in the surrounding farmland, where they might be the only house for a couple miles. Coming to work was their only chance to see people. One of the guys I worked with couldn't even GET internet service, since the only road to his house crossed state lines, and thus fell into the purview of two competing cable providers. So our productivity and employee happiness DROPPED by about 20%.
It's impossible to make a blanket statement about working in the office or working from home being good or bad. Having more options, however, is good.