DISCRIMINATION, whatever mask it wears, pretty much always works the same way. It is about one person saying to another: you are not enough like me. A straight man says it to a gay man. A white man says it to a black man. A straight woman says it to a trans woman. And now the governing body of athletics is saying it to Caster Semenya: you are not enough like our definition of a woman and you must take drugs to change it. I can barely believe it has happened.

So why has it? I think partly it’s because Semenya, who was born with differences of sexual development which mean she has higher than average levels of testosterone, doesn’t conform to the old, persistent ideals of feminine beauty – it was Semenya’s physical differences that first led to questions about her sexual identity. It would seem that all of us like women athletes to excel physically but many of us expect them to do it only within the traditional parameters of how women should look.

The typical male spectator probably likes it this way because, if a woman athlete looks like a woman, there can be no question over his sexuality, but women athletes also appear to go along with it. Some of them have spoken about the pressure before events to do their hair and make-up so they look good – i.e. feminine. Others have made disgusting and prejudiced comments about Caster in private, based on how she looks. In the end, all of it underlines a depressing message to women from both men and women: be strong but not too strong; be a great female athlete but remember to look sexy too.

None of this is a new problem – just ask Martina Navratilova or Fatima Whitbread – but it may reflect the fact that sport has never really been the greatest friend of equality. For a start, it’s predicated on the idea of winning or losing; men’s sport is also based on a proterozoic set of rules about masculinity, rule number one being you must fancy women, which is why there’s still no openly gay man playing professional football in the UK. And kids who don’t fit in are still being forced on to the pitch to fail. My memory of games at school is about feeling inadequate and fearful. Sport never made me feel equal – quite the opposite.

Those who would defend sport and the ruling against Caster Semenya – like those who defend the attempts to exclude trans women from women’s sport or women-only spaces – say their position is based on science. But the science is just not that clear.

For a start, not everyone has either XX or XY chromosomes and is therefore either clearly biologically female or male. That means you can try all you like to draw a clear line between men and women – and the sporting authorities are trying to do it with Semenya – but the line can never be arbitrary because neither biological sex nor gender is binary.

Read more: Caster Semenya loses legal fight with IAAF

The position on testosterone is just as complicated. The sporting authority in Semenya’s case, the IAAF, says the testosterone in her body gives her an unfair advantage but the link between testosterone and athletic performance is far from clear; it is also unclear how it inter-relates with other factors – height for instance or something more nebulous like talent. And testosterone is an unreliable indication of male and female anyway – almost one in five men have lower than average testosterone and some 13 per cent of women have higher than usual levels.

But still the sporting authorities, and some feminists, and almost everyone who designs toilets and changing rooms try to stick to the old ways. They say they’re doing it to defend women’s rights – the right to take part equally in sport or the right to enter a women-only area free of the risk of an attack by a biological man – but this seems to me to misunderstand both the concept of equality and risk. In fact, there is no such thing as equality in sport – some people cheat, some people train harder, some are physically stronger, and some, such as Caster Semenya, have a great natural gift. Forcing Semenya to take drugs to lower her testosterone is not going to change any of that - Semenya herself says all she wants to do is to run naturally, the way she was born.

The perceived risk to women from trans women, like the perceived threat to women in sport from athletes such as Semenya, is also monstrously exaggerated. There’s an idea that some trans women (or men posing as trans women) will sneak into female-only spaces and attack women. But not only is the risk vanishingly small, it’s a risk –like any other – that society should manage for the sake of human rights.

To use another example, we all know that there’s a risk to children from paedophiles and other criminals, but we don’t therefore seek to ban all adult contact with children; instead, we accept that the risk exists and, for the sake of a greater good, seek to manage it – and the same rules should apply to trans women who may commit crimes. Some of you may say the two issues – trans women and intersex woman – are different, but no: it’s all part of the same attack on the rights, visibility and representation of gay, trans and intersex people in public life – the attack on difference.

Sadly, given the result of the Semenya case and the angry virulence of the critics of the Scottish Government's pro-trans legislation, I have to say I think the debate appears to be going in the wrong direction – you might even say the enemies of difference are in ascendance. Thankfully, there are some more progressive voices – a few female athletes have supported Semenya and the recent open letter from women supporting the right of trans women to self-identify was extremely heartening.

However, in the end, I’m worried that the prejudice against Semenya – prejudice dressed up as biological truth – will embolden others. They will say it’s about equality and protecting women’s rights, but it’s really about something deeper and darker: a fear of women who do not fit the traditional ideals, a suspicion of difference, and an existential horror at the idea that humanity – no matter how hard the people in charge of sport try – doesn’t fit into two neat boxes.