The question is "in a given medical speciality -- internal medicine in this study --, are patient's outcomes related to the admitting physician sex?", not if women make better doctors than females. As such, your point about the best doctors not being in internal medicine is pretty a non sequitur.
Basically, I see two potential biais that could explain at least part of the difference in outcomes :
1. Its is "common knowledge" that male doctors tend to refuse admissions more often than females. (I am not aware of any hard data to prove this point) It could be that the patients that they do admit are somewhat sicker that those they let go directly home. That could explain both higher mortality and re-admission rates.
2. It is again, "common knowledge" (again, I'm not aware of any study) that women write better discharge summaries, including all co-morbid conditions. When coded in a database, those patients will appear sicker than similar ones treated by male doctors, and this could skew any analyses.
A final confounder is that patients often have many doctors during the stay, both male and female, and the study assigned as "the" doctor the one who billed most for the patient, which may not be the one who had the most impact on outcomes. It is difficult to say how this would advantage any particular sex, however.