Well apparently he needed it because they felt his coding skills weren’t good enough to hire
We don't know that. Perhaps someone else appeared to have more skill.
Or they had too many applicants and ignored him randomly, or they had an internal transfer, or they decided they didn't like his resume and never even looked at his code (no cost to have him do the exercise after all...), or they didn't like his style of tabs vs spaces, etc.