If your a small company developing something closed source is there any reason to use GitHub over just setting up a git infrastructure on your private server?
To be a little less flippant, small companies don't have an IT department to setup and maintain a git server ... and more. GitHib is also an issue tracker. It's also a (minimal) static webhost. And it's also a way to run actions on your builds.
All that isn't trivial to setup or maintain, so small folks especially will often find it cheaper and faster to pay M$ for all that.
And once you’re no longer a small company, setting up any server comes with a pile of bureaucracy. As a dev, I don’t want to set up a server when 80% of the work is filling out SOC 2 change management forms and dealing with crowdstrike. (And nobody wants to spend time debugging why crowdstrike makes the CI pipeline slow or arguing with your auditors about why your ephemeral images don’t actually need crowdstrike.)
Only reason that I see is that is free to use, why other alternatives are either paid or you needs to be hosted (and thus you need to pay the cost of a server and the work to maintain it).
Free means it's not yours, and could disappear or change at any time.
If you are a small software company, presumably your code is your most important asset. You should be self-hosting that, then you can know exactly where it is and whether it's actually backed up and you can instantly talk to the person who is responsible for it.