ThisIsMe :
This is nothing more than Google vs. Microsoft. They are competitors. Why would Google want to pay for a service that's owned by Microsoft? Why would Google want to pay for a service that's running on Microsoft's cloud services? So Google invests a ton of $$$ in another service to offset the cost of moving to their cloud platform and to upgrade features to make them more competitive.
Couple of issues with that. First, the article says Google bid against MS to buy github, which is probably why the purchase price was so astronomical. So, this move shouldn't be seen as purely reactionary.
Second, I feel like google did/does have its own site (code.google.com?), but it shared a similar fate as Google Plus - no one uses it. So, to engage the opensource community, I guess they figured you've got to meet developers on their own turf. Their gitlab investment is definitely
not about saving themselves the cost of upgrading their own services.
Finally, all they really have to do against github is not screw up gitlab. There was already a mass exodus of developers and projects, when MS bought github. Too many people don't trust MS. In fact, that exodus probably ramped up gitlab's burn rate, making the need for more investment imperative.