There seems to be unfortunately no mechanism to keep this from happening. This is not the first time it has happened: Libya got the chairmanship in the past, under Gaddafi. The problem is that, as farcical as this seems, how could you stop it? It's not even "the UN's fault", it's what member states vote on.
Any formal definition of not-good-for-human-rights would get vetoed by Russia and China. And be careful what
To paraphrase a comment, once you wishstart excluding countries for "bad behavior" in one domain, forit can spread to other domains. For example I could see, while the subject here is Human Rights, it stands to reason that if lack of performance on a hypotheticalsubject triggers exclusion, then this mechanism forbiddingcould be used to deny US membership on any UN climate change committee.
Soft power and persuasion decide these types of things, and the West isn't particularly unified right now, nor. Nor is it immune from criticism regarding human rights.