Microsoft is trying to do what is necessary now to protect their future, which sometimes means doing hard things like the layoffs. If laying off people and saving that money will help the Company right now then in the future they could always rehire. Sometimes you have to suffer now to get rewarded later.
For any company to grow effectively and realize its objectives, it has to undergo some kind of restructuring. As such, Satya Nadella of Microsoft announcing the cut of 18,000 positions should be taken as a positive move toward the rebirth of the company. This move is very essential especially with the acquisition of Nokia and all of its mobile division since it will enable it to effectively integrate it within its management structure.
If you look at it by just the wording of your question, it looks gloomier than it actually is. The simple fact is that Microsoft was already a seasoned tech company prior to its acquisition of Nokia and they don't really need all of the Nokia employees. They have plenty of manpower and infrastructure to spread around, and that's just from the aspects of Microsoft that are public knowledge. Now if the company they had acquired were to be from an industry that they themselves might consider to be completely foreign to them, a good example might be if they had purchased Tesla, then they probably wouldn't be laying off as many people. This would be almost on par with King buying Zynga. There isn't that much that they don't already know or can't already do, so they don't really need all the extra people.
Obviously when you take into account the sheer size of Microsoft as a corporation, the numbers are put into context, but 18,000 people is still a massive number for any company. It might be right for Microsoft now, but the talent and experience they've lost with those people might be something they need in future.