Microsoft is a relative underdog now (among the tech giants). Underdogs tend to benefit more, personally, from the greater good, and also have less clout with which to push others around. This makes them come off as being more humble, and if they're smart they lean into that image in their public relations. Just look at AMD and T-Mobile.
With this move Microsoft is trying to fertilize a shared resource, investing some of its own money but also hoping to pressure Amazon - the company it's trying to get a leg up on - to invest alongside it. Amazon has less need for the shared resource and would have to contribute a greater amount to it. On top of that, Microsoft gets some positive PR. It's a smart move.
Edit: I've been informed that Microsoft is currently #1 in market cap, so not an underdog overall. They feel like an underdog in most isolated product categories, but maybe this really is purely a PR move.