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.
Being in the office at least ensures you're not in another office.