It's quite simple: Wording. Somebody might have gotten sloppy writing requirements for the new position, or HR may have misunderstood the requirements.
This may be enough to give the rejected applicant ammunition for a law suit. I've been to several interviews where I've had to dig out that what they say they're looking for doesn't match the position they actually want to fill.
I'm a straight, white male in my thirties, so discrimination is far from my mind. Other people may form different ideas, though..