I endorse everything my colleague Farhad Manjoo has to say about the stupidity of banning people from working from home, but in the spirit of generosity I wonder if that's even really what this is about.
Say you're Marissa Mayer and your diagnosis is that Yahoo would benefit from some staff reductions. But you also feel that kicking off your tenure with a new round of layoffs would be bad for morale. You think you have some reason to believe that the full-time workers on the Yahoo staff who work from home are a disproportionately low-productivity cohort. Announcing this new policy becomes a way of reducing the size of the staff without throwing everyone into a panic about layoffs and cost-cutting and oh-my-god-should-I-be-looking-for-a-new-job-elsewhere. It's just the new boss putting her stamp on the company.