Forcing all employees to work in the office says their managers do not have the skill to manage a remote work force. Whether that is true or not is beside the point; that's the message it sends. Technology now makes working from home, or the local coffee shop, as easy as working from a remote office. Whether the employees are as productive working from those locations is a management judgment that requires corrective action if they are not. If the reason for Yahoo!'s new policy is that most, or almost all, of their remote employees are not as productive as office-based workers, a better management action might be to replace those workers, and the managers who are not capable of getting the required production from them, rather than revoking a policy (telecommuting) that has substantial benefits for the company.
As the article Management By Attendance points out "People management styles change over time as we improve our understanding of human motivation and continually seek to maximize the performance of our organizations. Using a management style that was popular decades ago and expecting maximum results is silly. Instead, learn from those old styles, but adopt the newer, proven techniques like telecommuting.

From what I’ve read here or there, Yahoo HAS a big management problem.
According to Paul Graham – http://paulgraham.com/yahoo.html – they never had the top-level developpers their contenders(Google, Facebook, Microsoft, Apple…) tend to field. Instead, they have grown so quickly that they have a lot of mediocre people having another job at their home while still being paid full-time by Yahoo.
Plus, management is so bad that most of those people are not clearly identified
It seems that the idea is to force them to come home, identifiy them, fire those qho don’t come, & fire those who come & don’t fit the harsh standards of their industry. For most firms in this world, it would be a bad move, as you did describe. For Yahoo!, maybe not : their reputation is already bad, everything is in mess, and they need a big clean-up before trying to progress again.
They will have togh time recruiting top-level talents with such a policy, but as they don’t have much talent already, the hit will be lower than for most other firms.