I think we've all had days where we've gotten to the office and had a problem we're working on that doesn't get solved that day. It is actually really taxing and feels really bad to not accomplish anything, as if you've wasted the day.
I've found that the ability to more strictly control distractions at home--not needing to deal with the pressure to chat with co-workers and eat lunch together, for example--has led to far, far fewer days of no-solution. At the same time, it becomes even hard to "give up" on that day's productivity and clock out, since there's no real leaving the office.
Being in the office at least ensures you're not in another office.
How? If I'm willing to work another job while I'm at my first job, no one would know if the code I'm working on my screen belongs to job #1 or job #2.
The employer could use screen monitoring, but then they could do that while I'm at home and see that either I'm working on a second project, or that my computer is idle for long periods of time when I'm supposedly "working".
Though I'm not sure it matters - if I can work 2 jobs and still provide adequate productivity to each employer, then why do they care?
I have so many meetings every day that I'm sure that I couldn't get away with working 2 jobs at once, even when fully remote.
Measuring programming productivity per person is very hard.
Measuring 40 hour attendance is easy.
So while everyone agrees that A would be better, in reality the approximation of B will have to do.
I still work out some things on paper—I think well that way. Other times I have to get up and walk around to work something out in my head. I'd look like a constant slacker.
My experience has been almost the inverse of this. I wouldn't quite say 80% of people are less productive at home but I'd think at least above half? For various reasons mentioned elsewhere here (disruptive home environment, can't communicate effectively with co-workers remotely, etc). Many people just become very unproductive if they're not physically in the presence of other people being visibly productive.
I'd like to see some formal studies into this to get the true split.
Personally, I hope the future for work becomes as remote as possible as near to a 4 day week as possible.