Github makes money without producing open source software. <rant>Well, that is if you don't count a sluggish electron-based text editor.</rant> Github is not open source, Github Pages is not open source, Github Actions is not open source. Sure, they offer free hosting for open source projects, but that kind of charity creates a hard dependency on Github for many projects, which is not healthy for the ecosystem.
What happens if Github closes? Or stops free offers for open source projects? To make an analogy from another ecosystem, if Mac Donalds started offering free meals to homeless people, that would not solve the problems of poverty and would not contribute to healthier food for the people or a more sane/ecological agriculture. That'd just be charity for their own gain.