I think it's appropriate that gender discrimination laws can work both ways, but this is a bit of a strange one, sounds like all the candidates would have been suitable, and the guy was a 0.25% more qualified.
If there is no wriggle room on qualifications then why bother with interviews or anything.
I've interviewed people who seemed brilliantly qualified, but when you get them face to face can't answer the most basic of questions.