As for the "how can they", the answer is remarkably simple: it's hurting their bottom line and there's no indication that a better strategy exists in the markets they're active in. If you don't understand why they don't just pour resources into mobile: resources are finite, and Microsoft is not the powerhouse it once was. Budget is allocated based on return of investment, why invest in a segment that you can see failing year over year. The best call is to wind it down and make new and exciting things that people didn't even know they wanted instead.
This new Surface Studio is a remarkably good step in that direction.