Google wanted to create a place open source people actually wanted to be, and had reliable hosting, instead of a place people had to sadly live with that was pretty unreliable (no offense meant to my friends at sourceforge).
Doing so jump started some competition in this space.
While github is slowly becoming a monoculture again, it doesn't appear to slowly be growing crappier or less reliable.
I'm sure in 5-10 years something like Google Code will be necessary again.
(Google code was the first engineering project I worked on at Google, for a few years starting in 2006).