To the company it was never, and as high a recommendation as the CEO would be; most people would agree they did the right thing. Unless you're hired before a hiring manager or whomever is doing the hiring you should follow the process. If you treat it like a joke because you feel entitled by your connections then be willing to accept the outcome.
That person should be fired, for being unprofessional and for inability to adapt to a trivial non-standard situation ("normally we test the applicant's technical competency with a take-home test; now it already has been established; so I need to stop wasting everybody's time and spend my time doing something actually useful".)
Obviously, HR could still be useful in establishing a culture fit, but even then it's pretty much a formality since the CEO worked with and recommended the guy.
None of the other stuff you're saying is relevant. No point doing armchair psychoanalysis.
Clearly, the process (of cutting technically incompetent people while letting through the technically competent ones) is not working properly; that alone is fireable incompetency ("You had only one job and you failed at it!").
Another fireable thing is that HR does not understand that they are under the CEO, they are implementing the CEO's vision, in the way he envisioned. But instead of that, HR is indeed ego-tripping.