The government has defeated an amendment in the House of Commons that would have created a defence of “free speech” in a bill that is designed to criminalise incitement of hatred in relation to sexual orientation.

Campaigners including the Blackadder star Rowan Atkinson and the gay actor Christopher Biggins had argued that the clause relating to hatred in the Coroners and Justice Bill could limit freedom of expression and could lead to prosecutions over gay “jokes”.

The Coroners and Justice Bill is being used to remove an amendment to legislation passed last year that allowed the “discussion or criticism” of sexual practices last year.

The amendment that was defeated today by 154 votes, would have effectively re-instated the defence of free speech.

Labour MP for Leicestershire North West, David Taylor said his proposals would have made it clear that “discussion or criticism of sexual conduct is not caught by the homophobia law”.

Conservative Shadow justice secretary Dominic Grieve supported the amendment saying: “We cannot have a working democracy without the underpinning of freedom of speech, which also requires the tolerance of the opinions of individuals who we may think are either bonkers or which we dislike.”

Former Conservative Home Office minister and MP for Maidstone and The Weald said: “We do not live in a moderate state, we do not live in a state which is restrained in the way that it applies law.

“And out there in the country, in case ministers are completely oblivious of it, there is a swelling unease about freedom of speech.”

Adding: “Laws that seek to bring equality have actually got a very, very oppressive heart. The face maybe liberalism but the heart is oppression.”

Just one Conservative MP, John Bercow, voted with the government and in favour of anti-gay hate legislation. 53 Liberal Democrats supported the government.

But former Labour minister Tom Harris, MP for Glasgow South was one of a number of Labour MPs who defied a three-line whip to vote against the government saying: I have a long history of support for gay rights in this House and it is a matter of some regret that I have to speak against what the Government is trying to do tonight.”

Justice minister Bridget Prentice said that banning gay hate speech would protect victims of threatening behaviour. But that it would be applied in a reasonable way so that someone expressing concerns about homosexuality “do not need to fear that they will be caught by the criminal law.”

Last week, the Blackadder star Rowan Atkinson warned a House of Lords committee that the government risked creating a culture of “censoriousness” by removing free speech.

He said: “Do I think that I would risk prosecution because of jokes or drama about sexual orientation with which I might be involved if we don’t have the free speech clause?

“Not really – but I dread something almost as bad – a culture of censoriousness, a questioning, negative and leaden attitude that is encouraged by legislation of this nature but is considerably and meaningfully alleviated by the free speech clause.”

“I do not believe that legislation of such a censorious nature as that of hate speech, carrying as it does the risk of a seven-year jail sentence for saying the wrong thing in the wrong way, can ever by justified merely by the desire to ‘send the right message’.”

He cited Christian groups as being “particularly concerned” the law will be used against them, adding that “heavy-handed police intervention” had been used before in instances of groups condemning gays and lesbians.

The gay actor Christopher Biggins last week also came out in favour of the amendment saying “Showbiz, camp theatrics and dazzling wit helped to pave the way for gay rights. They should be cherished, not suppressed.

“It is bitterly ironic that, in the name of tolerance, the government should be marching towards such a culture of intolerance.”

The government defeated the amendment with 328 votes to 174.