Why did they even shortlist, interview, and assess a female candidate if there was absolutely no chance of her getting the job?

If they only want a man, then don't interview women and get their hopes up for nothing.