GitHub would probably have less of a problem with open sourcing their code because their primary value prop isn't that they've built some brilliant software but that they take the bother out of managing your source hosting.
GitHub is making money by selling their proprietary pack to other corporations so they could implement it on their own server. If they release it for free, they wouldn't be able to support free code hosting services and remain profitable.
They're also selling premium plans for the regular users, but I don't think that this gives them enough profit to remain profitable.
It's only when you go all the way down to the "lifestyle" sized companies that I see real dedication to the open source ideals. They're willing to put their entire product on github. Props to those founders, but it's pretty insignificant because those businesses are so small.
Most people don't have the skills to run their own servers, and nor can we expect them to. Service based products are the future, but I hope that interoperability gets to the point where customers can switch painlessly between different providers. That would put a lot of leverage back in the hands of the end user. If I had to name one problem it would be lock-in, not proprietary code.
I remain hopeful that the standard SaaS business model dovetails nicely with free and open source software.