My guess is that Semenya is XY, born with one of the most common XY birth defects in babies, undescended testicles and underdeveloped male organs. Cheaper and easier in a poor African village to operate so as to turn into a "female", raised as a girl and it only becomes more obvious when the secondary sexual characteristics develop at puberty. Clearly identifies as a male - married long term girlfriend, dressing in tribal male clothing, etc..
My other guess is that these physical defects would be easily cured by surgery (undescended testicles can be relatively easily fixed).
My reason I'm guessing is that the politically correct, career sports administrator wallflowers would rather half the population (female) suffers detriment to their inability to exclude men from womens' races.
Two other men in the womens' 800m final as well, also brought up in poor African villages - Niyonsaba and Wambui.