A marriage guidance counsellor's bid to challenge his sacking for refusing to give sex therapy to homosexuals has led to a serious clash between the Christian lobby and the judiciary.

In a powerful dismissal of the application to appeal, Lord Justice Laws said legislation to protect views held purely on religious grounds could not be justified. He said it was an irrational idea "but it is also divisive, capricious and arbitrary".

The former archbishop of Canterbury Lord Carey had sent a statement to a judge hearing the appeal application by Gary McFarlane. The senior church figure called for a special panel of judges with a "proven sensitivity and understanding of religious issues" to hear the case.

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

Lord Justice Laws's ruling said: "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 15 April.

McFarlane, 48, from Bristol, wanted permission to appeal against an employment appeal tribunal ruling that 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.

"The comparison of a Christian, in effect, with a 'bigot' (ie, 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 appeal court, ruled last December that Lillian Ladele, a Christian registrar, was breaking discrimination laws by refusing to conduct civil partnership ceremonies.

Referring to that case, Lord Carey said: "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".