The Queen's announcement of a posthumous pardon, under a Royal Prerogative of Mercy, to Alan Turing follows a long campaign and a petition signed by more than 37,000 people. The pardon will be welcomed by many, and it is undoubtedly a gesture of humanity, compassion and progressive values. It is also entirely, profoundly wrong.

Turing was an intellectual legend of the 20th century. His breakthroughs in applied mathematics have led him to be described as the father of modern computing. His work on the Enigma codebreaking machine made him more responsible than almost any other British individual for the ultimate defeat of Nazi Germany. Biographers recall him as a gentle, modest, reserved man. He was also gay, and in 1952 he was convicted of gross indecency - the catch-all legal term used to prosecute any consenting sexual acts between two men. The judge at his trial, acknowledging the importance of Turing's work, laid down what seemed at the time to be a lenient sentence. The mathematician was spared jail and ordered to undergo an experimental hormone therapy for homosexual urges, often dubbed "chemical castration". We know now the treatment will not have affected his orientation or desires, but it did cause physical changes including breast enlargement and erectile dysfunction.

Turing described the experience as horrible and humiliating and less than two years later, he died of cyanide poisoning. An inquest recorded a verdict of suicide. It is a tragic, shameful episode in our recent history, but while the tragedy was Turing's, the shame was entirely the nation's.

In announcing the pardon today, the justice secretary, Chris Grayling, said: "A pardon from the Queen is a fitting tribute to an exceptional man." Turing was certainly an exceptional man but the tribute could not be less fitting. It says that the British state is prepared to forgive historical homosexual acts providing they were performed by a national hero, academic giant or world-changing innovator. This is the polar opposite of the correct message. Turing should be forgiven not because he was a modern legend, but because he did absolutely nothing wrong. The only wrong was the venality of the law. It was wrong when it was used against Oscar Wilde, it was wrong when it was used against Turing and it was wrong when it was used against an estimated 75,000 other men, whether they were famous playwrights and scientists or squaddies, plumbers or office clerks. Each of those men was just as unfairly persecuted, and many suffered similarly awful fates. To single out Turing is to say these men are less deserving of justice because they were somehow less exceptional. That cannot be right.

It is shocking to realise that there are still people alive today who were unjustly criminalised in their youth, and who have carried the stain of a criminal record, as a sex offender, through almost their entire adult lives. In 2012 the Protection of Freedoms Act was passed, which allows those who were convicted of homosexuality offences to apply to have their entire criminal records removed if the facts of the case would no longer count as a crime.

As the legal commentator David Allen Green has pointed out, there is no reason why this provision could not be extended to cover all those convicted, whether living or dead, without the requirement for a personal application. With a little bit of political marketing, it could become known as the Turing law, recorded as such in the history books for generations to come. Now that really would be a fitting tribute to a national hero.