I would definitely hire the woman assuming that she actually graduated from medical school and is a qualified doctor. In other words, so long as she is competent, I would hire her regardless of the man's superior qualifications. I do not think that this would end up coming under the heading of affirmative action. Affirmative action applies when the "minority" candidate is less qualified, and I do not think that is the case here.
The reason I would hire her is that she would likely be better at the job. A doctor is not just a medical computer. Instead, a doctor has to be able to interact well with patients and win their trust. This will allow the doctor to better diagnose patients and have a better chance of getting them to do what he or she says. When looked at this way, the woman is going to be a better doctor for this situation. She will understand her patients much better than the man would and will not make cultural mistakes that would alienate patients.
Therefore, in this case, the woman is the better qualified of the applicants and I would hire her.