Many countries will ask "have you ever been denied entry before to [any] country?", and proactively deny you entry. Seems a punishment to me, not necessarily a "mere" formality.
From the country's point of view, this policy seems like a conservative filter for entrants who might violate regulations, cause damage or even harm the existing residents. But, yes, there are false positives and false negatives to any such policy. And, of course, such a policy might include the provision for an appeal.