By Andrew Osborn
LONDON (Reuters) - British Prime Minister David Cameron's flagship gay marriage policy deepened a rift in his own party on Monday after many of his own lawmakers defied him in a sign of growing strains on his leadership and his coalition government.
Almost 40 percent of Cameron's 303 lawmakers in the lower house of parliament voted for an ultimately unsuccessful amendment that would have allowed registrars to refuse to perform gay marriage ceremonies if they objected.
Scores backed another amendment that the government said would have sabotaged its efforts to legalize same sex unions.
Cameron's failure to unite his ruling Conservative Party over gay marriage and over his other major policy - renegotiating Britain's membership of the European Union - risks undermining his chances of being re-elected in 2015 even as the economy is showing signs of returning to growth.
"It's a perfect political storm. It couldn't have come at a worse time for Cameron," Iain Dale, a prominent gay radio presenter and conservative blogger, told Reuters.
The revolt, the second of its kind on gay marriage, is likely to damage Cameron's credibility.
To compound his discomfort, he is also battling to squash a perception that he despises his own party members for being too conservative after newspapers quoted an unnamed member of his entourage as calling activists "mad, swivel-eyed loons".
The word "loon", meaning a crazy person in British English, dates back to the 15th century and was used by Shakespeare in Macbeth. Conservative activists say they want an apology for being insulted. Cameron wrote to party workers on Monday to try to reassure them that he and his allies weren't sneering at them.
Geoffrey Howe, the former foreign secretary who helped trigger the downfall of Margaret Thatcher, has accused Cameron of losing control of his party, deepening the sense of gloom.
And for the first time since he was elected in 2010, Cameron himself has raised the possibility that his two-party coalition might not hold together until 2015 as policy differences with his junior partner, the Liberal Democrats, become more acute.
The new law being debated on Monday proposes legalizing same-sex marriage, something rights groups say is overdue. The opposition Labour party and the Liberal Democrats back it.
Cameron is trying to perform a tricky balancing act: to reconcile his desire to show his party is progressive, with the views of many in it who are uncomfortable with such a reform. Many say their Christian beliefs lead them to oppose marriage other than between a man and a woman.
The bill, which is many stages away from becoming law, has infuriated activists who say it will damage the party's electoral hopes.
Tim Loughton, the Conservative MP who introduced the amendment critics regarded as an attempt to sabotage the bill, said Cameron's determination to push for gay marriage "hadn't helped" relations with his own party.
"It was a mistake," the MP told Reuters.
In a phone interview, David Burrowes, another Conservative lawmaker, said Cameron had misjudged the situation by introducing a bill he said was "an unwanted distraction".
"I warned him, others warned him. This was self-inflicted," he said.
Under pressure from the UK Independence Party, an anti-EU party which opposes immigration and did well in local elections earlier this month, Cameron has had to hastily tack to the right to try to ward off a possible electoral threat.
Cameron's response to potential setbacks from within his own party has so far been to say he is "relaxed" about his own lawmakers voting against him, portraying their defiance as a sign that Britain is a healthy democracy.
Yet as his own authority has been eroded, some of his own ministers have begun to publicly break ranks on issues like Europe and gay marriage, fuelling talk of a possible leadership challenge, though most believe that won't happen until after the next national election in 2015.
The gay marriage vote, one of several in a two-day debate, took place days after his own lawmakers bounced Cameron into backing a bill to make his promise of a vote on the country's EU membership legally-binding, a blow to his authority.
Cameron has tried to satisfy eurosceptics in his own party by promising an in-out vote before the end of 2017, but each time he has given ground his own lawmakers have demanded he do more on an issue which has toppled two of his predecessors.
The next flashpoint for Cameron is likely to come at the end of June when he must decide which government departments absorb spending cuts to help repair the country's battered public finances, an exercise which has already seen his decision to safeguard foreign aid but cut the defense budget criticized.
Cameron's Conservatives trail the opposition Labour party by up to 10 percentage points in the polls, a position its strategists thinks give it a chance of winning the 2015 poll.
But the fear among many of them is that party infighting will torpedo any chances they might have.
"This sort of thing - the habit of distracting ourselves from what matters - has got to stop," said Michael Ashcroft, a former Conservative chairman.
"We hope to be elected in two years' time. We need to pull ourselves out of what threatens to become a spiral of irrelevance."
(Editing by Giles Elgood and Guy Faulconbridge)