Sure, except that storage is a commodity which you need to get pretty large scale to turn a decent profit, code is fairly light on on space. Github is able to charge a very large premium on it because of the unique service that they supply.
GitHub is certainly overpriced for its private plans, but I don't think releasing the source would destroy their profitability. Once the ball gets rolling on something like GitHub, network effects play a major role in its continued usage and popularity. Good support and constant evolution of the platform also encourage users to pay for your hosted service even if the code is available elsewhere. GitHub's features like pull requests, profiles, and expected presence on resumes as the de-facto standard "git hub" (har, har, har), and overall convenience would continue to promote usage of github.com.
Github's widest margins are obviously at the high end business plans, and businesses would run an internal github in a second if it was OSS. There goes Github FI as well. It would cripple them, the only way they can possible host all open source projects at no charge is because they are subsidized by the big fish.
I'm not sure I buy the network effects argument. It makes sense for repositories for open projects, but for private repositories I don't see where network effects come into play.