The most valuable thing MS gets from its OpenAI dealings is that they can incorporate its AI in all their products. If you look at it as a defensive move to protect the value of Office, Windows, etc. from an AI focused competitor it's worth absorbing the losses. But try showing that on a balance sheet!
Plus, of course, if OpenAI makes money, that's also good for them.