Self-hosting anything is not trivial. You have to maintain your own infrastructure and backups.
Github is far more than a git repository. You’re almost never using it for just git. The real value is the ecosystem.