Should it be illegal to call the prophet Muhammad a “paedophile”? That was the question in front of the European court of human rights (ECHR) last week.

In 2009, an Austrian woman, known as ES, held “seminars” on Islam in which she likened Muhammad’s marriage to six-year-old Aisha to paedophilia. She was convicted of “disparaging religion”. In keeping with a history of supporting blasphemy laws, the ECHR upheld the conviction. ES’s comments, it ruled, “aimed at demonstrating that Muhammad was not a worthy subject of worship”. Presenting objects of religious worship in a provocative way capable of hurting the feelings of believers, it added, “could be conceived as a malicious violation of the spirit of tolerance”.

ES’s “seminars” were promoted by Austria’s far-right Freedom party. The claim that Muhammad is a “paedophile” is often the calling card of bigots, but that should not make it illegal. The ECHR ruling appears to confuse the protection of rights and of feelings. Believers should be free to worship, assemble and express their beliefs. But they possess no rights to have their beliefs protected from abuse, nor their feelings from being hurt. Calling Marx a monster or Gandhi a bigot may offend some, but they have to put up with it.

Once hurt feelings become a matter for the law, religious rights themselves become precarious. In 2006, after publication of the Danish cartoons, the Muslim Council of Britain’s Iqbal Sacranie made derogatory comments about homosexuality on Radio 4’s Today programme. Some gays were offended; the police investigated.

In response, Muslim leaders wrote to the Times demanding the right to “freely express their views in an atmosphere free of intimidation or bullying”. Those same leaders would have denied that right to newspapers publishing cartoons mocking Muhammad. They are, no doubt, applauding the ECHR ruling.

There is more to this than hypocrisy. In criminalising the giving of offence, religious belief itself may face the censor’s cut. Muslims in particular should beware. In today’s climate, it is Islam that is often targeted, from calls to outlaw the Qur’an to attempts to restrict Muslim worship. Far from protecting the vulnerable, as many claim, such laws help nurture reactionaries, both within Muslim communities, and outside.

We should no more support secular versions of blasphemy laws than the old religious variety

The day after the ECHR ruling, Ireland held a referendum on its blasphemy law. Exit polls suggest overwhelming support for scrapping the constitutional ban. This is in keeping with European trends – Britain abolished its blasphemy law in 2008 – but while blasphemy laws are disappearing, the idea of “the blasphemous” is not.

Blasphemy has always been as much about preserving social order as protecting religious beliefs. In 1676, England’s lord chief justice, Sir Matthew Hale, observed that Christianity was central to social life and to permit it to be disparaged would “dissolve all those obligations whereby civil societies are preserved”. The outlawing of blasphemy was a necessary defence of secular political authority.

By the late 20th century, Britain had become more culturally and religiously plural. To uphold social order, many insisted, it was now necessary to protect all faiths.

In 1977, in Britain’s last blasphemy trial, Mary Whitehouse brought a private prosecution against Gay News for publishing James Kirkup’s poem The Love That Dares to Speak its Name, which describes a centurion’s love for, and sex with, Jesus. Whitehouse won the case. When Gay News appealed, the law lords upheld the verdict. In his judgment, Lord Scarman wrote that blasphemy laws “safeguard the internal tranquillity of the kingdom”, adding that one needed “not only to respect the differing religious beliefs, feelings and practices of all but also to protect them from scurrility, ridicule and contempt”.

Old-style blasphemy laws have given way to new legislation against hate speech and constraints on the giving of offence. Ireland’s repudiation of blasphemy and the ECHR’s opposition to the disparagement of religion may be two sides of the same shift.

We should no more support secular versions of blasphemy laws than the old religious variety. However different the motives, Muslims should not be protected from vilification of Muhammad any more than Christians from a poem some find vile. Sacranie should be able to call homosexuality “harmful”. ES should be able to label Muhammad a paedophile. And we should be free to challenge both as robustly as we wish.

• Kenan Malik is an Observer columnist