Just looking at the numbers, they are spending $5G and losing $1G. Their subscriptions are growing. So if they grow another 25% they are making money. (Ignoring infrastructure costs which are most likely a tiny fraction of per-user revenue.) They also just launched an Android app. So I think their story is looking pretty good. Not even considering that it raises the value of Apple TV hardware, their other devices and gives them more lock-in for customers in general that seems like a great investment they made.
They want to make money off of services, every service they offer requires a Microsoft account to purchase and use. Everyone that they force to make an account during setup is one step closer to paying for a Microsoft service.
There are obviously tradeoffs (less sales of these versions of windows and some users pushed away from Windows altogether among others), but the motivation is clear.