The British media were right, on balance, not to republish the Danish cartoons that millions of furious Muslims protested against in violent and terrible destruction around the world. Reprinting would very likely have meant more people killed and more property destroyed. It would have caused many British Muslims great pain because they would have been told that the publication was intended to show contempt for their religion, and though that perception would have been inaccurate and unjustified the pain would nevertheless have been genuine. True, readers and viewers who have been following the story might well have wanted to judge the cartoons' impact, humour and offensiveness for themselves, and the media might therefore have felt some responsibility to provide that opportunity. But the public does not have a right to read or see whatever it wants no matter what the cost, and the cartoons are in any case widely available on the internet.

Sometimes the media's self-censorship means the loss of significant information, argument, literature or art, but not in this case. Not publishing may seem to give a victory to the fanatics who instigated the violence and therefore incite them to similar tactics in the future. But there is some evidence that the wave of rioting and destruction - suddenly, four months after the cartoons were first published - was orchestrated from the Middle East for larger political reasons. If that analysis is correct, then keeping the issue boiling by fresh republications would actually serve the interests of those responsible and reward their strategies of terror.

There is a real danger, however, that the decision of British media not to publish, though wise, will be wrongly taken as an endorsement of the widely held opinion that freedom of speech has limits, that it must be balanced against the virtues of multiculturalism, and that the government was right after all to propose that it be made a crime to publish anything "abusive or insulting" to a religious group. Freedom of speech is not just a special and distinctive emblem of western culture that might be generously abridged or qualified as a measure of respect for other cultures that reject it, the way a crescent or menorah might be added to a Christian religious display. Free speech is a condition of legitimate government. Laws and policies are not legitimate unless they have been adopted through a democratic process, and a process is not democratic if government has prevented anyone from expressing his convictions about what those laws and policies should be. Ridicule is a distinct kind of expression; its substance cannot be repackaged in a less offensive rhetorical form without expressing something very different from what was intended. That is why cartoons and other forms of ridicule have for centuries, even when illegal, been among the most important weapons of both noble and wicked political movements.

So in a democracy no one, however powerful or impotent, can have a right not to be insulted or offended. That principle is of particular importance in a nation that strives for racial and ethnic fairness. If weak or unpopular minorities wish to be protected from economic or legal discrimination by law - if they wish laws enacted that prohibit discrimination against them in employment, for instance - then they must be willing to tolerate whatever insults or ridicule people who oppose such legislation wish to offer to their fellow voters, because only a community that permits such insult may legitimately adopt such laws. If we expect bigots to accept the verdict of the majority once the majority has spoken, then we must permit them to express their bigotry in the process whose verdict we ask them to respect. Whatever multiculturalism means - whatever it means to call for increased "respect" for all citizens and groups - these virtues would be self-defeating if they were thought to justify official censorship.

Muslims who are outraged by the Danish cartoons point out that in several European countries it is a crime publicly to deny, as the president of Iran has denied, that the Holocaust ever took place. They say that western concern for free speech is therefore only self-serving hypocrisy, and they have a point. But of course the remedy is not to make the compromise of democratic legitimacy even greater than it already is but to work toward a new understanding of the European convention on human rights that would strike down the Holocaust-denial law and similar laws across Europe for what they are: violations of the freedom of speech that that convention demands.

It is often said that religion is special, because people's religious convictions are so central to their personalities that they should not be asked to tolerate ridicule in that dimension, and because they might feel a religious duty to strike back at what they take to be sacrilege. Britain has apparently embraced that view because it retains the crime of blasphemy, though only for insults to Christianity. But we cannot make an exception for religious insult if we want to use law to protect the free exercise of religion in other ways. If we want to forbid the police from profiling people who look or dress like Muslims for special searches, for example, we cannot also forbid people from opposing that policy by claiming, in cartoons or otherwise, that Islam is committed to terrorism, however silly we think that opinion is. Religion must be tailored to democracy, not the other way around. No religion can be permitted to legislate for everyone about what can or cannot be drawn any more than it can legislate about what may or may not be eaten. No one's religious convictions can be thought to trump the freedom that makes democracy possible.

Ronald Dworkin is professor of law at University College London. His book, Justice in Robes, is published in April

comment@theguardian.com