It's not for being a social identity for programmers, or hosting open-source libraries. Those are worthy pursuits, but from a business perspective mostly serve as marketing.
Github is basically Microsoft Word for programmers, and is an essential part of their workflow. Companies that need enterprise functionality around security and flow configurability move to Github Enterprise and spend, not $7/month/organization, but $20/month per programmer.
That's why Github is being valued at $2B.