A marriage guidance counsellor's bid to challenge in the courts his sacking for refusing to give sex therapy to homosexuals led to a serious clash between Christians and the judiciary today.

In a powerful dismissal of the application to appeal, Lord Justice Laws said legislation for the protection of views held purely on religious grounds cannot be justified.

He said it was an irrational idea, "but it is also divisive, capricious and arbitrary."

Former Archbishop of Canterbury Lord Carey had sent a statement to a judge hearing an application to appeal by Gary McFarlane.

The senior church figure called for a specially-constituted panel of judges with a "proven sensitivity and understanding of religious issues" to hear the case.

Lord Carey said recent decisions involving Christians by the courts had used "dangerous" reasoning and this could lead to civil unrest.

The judge's ruling continued: "We do not live in a society where all the people share uniform religious beliefs.

"The precepts of any one religion - any belief system - cannot, by force of their religious origins, sound any louder in the general law than the precepts of any other.

"If they did, those out in the cold would be less than citizens, and our constitution would be on the way to a theocracy, which is of necessity autocratic.

"The law of a theocracy is dictated without option to the people, not made by their judges and governments.

"The individual conscience is free to accept such dictated law, but the State, if its people are to be free, has the burdensome duty of thinking for itself."

Lord Justice Laws quoted extensively from Lord Carey's statement when he gave his ruling on the application made on April 15.

He said Mr McFarlane's case was supported by the former archbishop and he said it was right that he should address what he says because of his seniority in the Church "and the extent to which others may agree with his views, and because of the misunderstanding of the law which his statement reveals".

Lord Carey began with his call for a special court to hear such cases, headed by the Lord Chief Justice, and said he disputed that the manifestation of the Christian faith in relation to same sex unions was discriminatory.

Mr McFarlane, 48, from Bristol, wanted permission to appeal against an Employment Appeal Tribunal ruling which supported his sacking by Relate Avon in 2008.

The father of two, who had worked for the national counselling service since 2003, had alleged unfair dismissal on the grounds of religious discrimination.

Lord Carey said: "The description of religious faith in relation to sexual ethics as 'discriminatory' is crude and illuminates a lack of sensitivity to religious belief."

He added: "The comparison of a Christian, in effect, with a 'bigot'(i.e. a person with an irrational dislike to homosexuals) begs further questions. It is further evidence of a disparaging attitude to the Christian faith and its values."

Lord Carey and other Christian leaders began expressing concerns after Lord Neuberger, who as Master of the Rolls is head of the civil Court of Appeal, ruled in December last year that Lillian Ladele, a Christian registrar, was breaking discrimination laws by refusing to conduct civil partnership ceremonies.

Referring to that case, Lord Carey said in the statement: "It is, of course, but a short step from the dismissal of a sincere Christian from employment to a religious bar to any employment by Christians.

"I believe that further judicial decisions are likely to end up at this point and this is why I believe it is necessary to intervene now."

He said the fact that senior clerics of the Church of England and other faiths felt compelled to intervene directly in judicial decisions and cases "is illuminative of a future civil unrest".

But Lord Justice Laws said Lord Carey's views were "misplaced" and judges had never likened Christians to bigots, or sought to equate condemnation by some Christians of homosexuality with homophobia.

He said it was possible that Lord Carey's "mistaken suggestions" arose from a misunderstanding of the law on discrimination.

As to Lord Carey's concerns over a lack of sensitivity on the part of the judiciary, Lord Justice Laws said this appeared to be an argument that the courts ought to be more sympathetic to the substance of Christian beliefs and be ready to uphold and defend them.

The judge said: "In a free constitution such as ours there is an important distinction to be drawn between the law's protection of the right to hold and express a belief and the law's protection of that belief's substance or content."

He said the Judaeo-Christian tradition had exerted a "profound influence" on the judgment of lawmakers.

"But the conferment of any legal protection of preference upon a particular substantive moral position on the ground only that it is espoused by the adherents of a particular faith, however long its tradition, however long its culture, is deeply unprincipled."

He said this would mean that laws would be imposed not to advance the general good on objective grounds but to give effect to the force of subjective opinion since faith, other than to the believer, was subjective.

"It may of course be true; but the ascertainment of such a truth lies beyond the means by which laws are made in a reasonable society

"Therefore it lies only in the heart of the believer, who is alone bound by it. No-one else is or can be so bound, unless by his own free choice he accepts its claims."

Terry Sanderson, president of the National Secular Society, said: "This is the right outcome for this case. The law must be clear that anti-discrimination laws exist to protect people, not beliefs.

"The right to follow a religious belief is a qualified right and it must not be used to legitimise discrimination against gay people who are legally entitled to protection against bigotry and persecution.

"Fundamentalists are mounting one challenge after another in courts and employment tribunals. They are trying hard to undermine the laws that protect gay people from discrimination. They are seeking to create a hierarchy of rights that places Christian dogma over the rights of people to fair treatment. They must not be allowed to succeed."

Lord Carey's comments that there will be civil unrest over such discrimination cases was "dangerous nonsense", said Mr Sanderson.

Andrea Williams, director of the Christian Legal Centre, said: "The notion that the Bible's teaching, of particular focus in this case on sex and marriage, is 'necessarily subjective being incommunicable by any kind of proof or evidence', is highly contentious to say the least.

"To put the reasonably held beliefs of Christians into such a category is alarming and in effect seeks to rule out Christian principles of morality from the public square.

"Mr Mcfarlane simply wanted his religious beliefs to be accommodated by his employer, which, in the specific facts of the case, was not unreasonable.

"It seems that a religious bar to office has been created, whereby a Christian who wishes to act on their Christian beliefs on marriage will no longer be able to work in a great number of environments.

"At the Christian Legal Centre we will continue to fight for people who find themselves suffering as a result of these kinds of judgments until the law once again recognises the public manifestation of faith within a free and civilised society."

Derek Munn, a director at gay pressure group Stonewall, said: "You can't refuse a service to a person based on their gender, race or disability, and you can't on the basis of their sexual orientation either.