There are some profoundly disturbing messages in all this, which seem totally out of keeping with the Olympic spirit. The most egregious is that it is not only applied to women alone, but that some people should be excluded from sport because they are 'different'. What sort of message does this send to young women other than that if you are any good you will be investigated as some sort of freak due to an assumption that women are inherently inferior to men, and that only masculine characteristics allow for achievment. Presumably grit, determination, courage, skill and hard work count for very little in modern olympics.
The science is flawed in that is assumed that any 'abnormality' creates some sort of unfair advantage. And what exactly is an 'unfair advantage'? Presumably athletes that are taller than average should also be excluded. It is difficult not to see that this is fundamentally gendered discrimination.
Bad science is also bad ethics. Not just the exclusion of certain people based on physical charateristics, but the likely impact failing such a test is likely to have on an athlete. Nor is it just the humilation and shunning (Soundarajan eventually attempted suicide) as an athlete, but the public labelling in terms of one's medical history. A history which is quite likely to have been unknown to the athlete in question. The likely effect on a woman of having her gender publicly questioned cannot be overestimated.
While it is understandable that concerns about fraud fuelled the original introduction of such tests, in fact such fraud is almost unheard of, and as a result women were subjected to the humiliation of having to parade naked in front of officials, to be inspected. The current sex tests have absolutely nothing to do with fraud and much to do with preconceived ideas of gender and femininity. These attitudes are vestiges of the terrible discrimination that women faced in sport and particularly the Olympics, for so long. Many might argue that women are still not treated as equals in competitive sport, or their sports taken seriously.
Sport and the Olympics should be about inclusivity, not exclusion based on prejudice.