I believe another reason some African countries have done this is to stick it to the European-led world sports governing bodies & to the nations of "the Global North" more generally.
Athletics South Africa decided to put Semenya forward as a runner in women's sports knowing that Semenya was XY DSD not just to gain gold, glory & $$, but to challenge the hegemony of white-dominated orgs like the IAAF/World Athletics & the IOC - & to use modern-day gender ideology to hoist the white "global North" by its own petard more generally.
Many ANC officials who had risen to power in the SA government by the time Semenya was dubbed SA's "golden girl" attended college/uni or grad school in North America or the UK when gender studies & queer theory were becoming all the rage on campuses. I don't think it's a stretch to think that a number of guys with astute political minds from SA cleverly realized that ideas coming out of Western academia - such as "sex is a spectrum, not a binary," "there are five sexes," "no one knows what a woman is" & "sex determination in humans is really hard to do" - could easily be used to challenge the system of sex categorization in sports as well as to protest Europeans' "colonialist," oppressively binary, & of course "racist" & "white supremacist" ideas about who is a woman.
Whilst the South Africans haven't succeeded in trying to end sex categorization in women's sports, they have by & large won the war in the court of public opinion. People here & on forums like letsrun.com widely see the Semenya saga for the scam & long con that it is, but most of the world sees it very differently. Most of the world doesn't view Semenya as an XY person who has made use of his male-only DSD to cheat in sports & to screw over women athletes. No, most of the world sees Semenya as a noble, put-upon "woman with naturally occurring high testosterone" who has been treated unfairly & cruelly by the IAAF/WA. Most of the world sees Lynsey Sharp as evil, & Semenya as a saint.