Just one problem with that: Every piece of work - code or otherwise, made by a human or not - may violate copyright law. There really is no way to know without actually checking against all other works (which you can’t because you don’t have access to all of them).
What GitHub does is what a sane person would do: React to claims. They just assume that what they get uploaded isn’t violating copyright until someone claims otherwise. And as it is literally impossible to actually know, that is the only sane way to approach this problem apart from just not hosting other people’s stuff at all.

The idea is probably to have an easy joker reason to randomly ban any repo which is for some otherwise hard to justify reason not wanted on the site. It’s a common corpo practice to have extra vague and impossible-to-disprove rules like that.