A leading family law judge has said that courts are secular – and so are judges.

Sir James Munby, president of the Family Law Division, said in a keynote speech (pdf) at the Law Society's Family Law Annual Conference: "Happily for us, the days are past when the business of the judges was the enforcement of morals or religious belief."

But balancing the needs of so many competing opinions and beliefs in a largely secular and religiously plural society presented an "enormous challenge".

"We live in a society, which on many of the medical, social and religious topics that the courts recently have to grapple with, no longer speaks with one voice," he said. "These are topics on which men and women of different faiths or no faith at all hold starkly different views. All of these views are entitled to the greatest respect, but it is not for a judge to choose between them."

Despite the country having an established church, he said: "We live in this country in a democratic and pluralist society in a secular state, not a theocracy. Judges have long since abandoned their pretensions to be the guardians of public morality".

It was not always so, said Sir James. He said that in Victorian times judges were regarded as protectors of morality and of the Christian faith. He cited some shocking examples of cruelly moralising judges, including the case of Annie Besant who was a leader of the National Secular Society in the mid-19thcentury. Munby said:

The high Victorian approach is wonderfully if appallingly exemplified by Re Besant in 1878 where it was held that the publication by the mother, the redoubtable Annie Besant, of a book condemned by a jury as an obscene libel was, in itself, sufficient grounds for removing her 7-year-old daughter from her custody. The obscene libel which had these terrible consequences for both the mother and her child was nothing worse than a treatise on contraceptive methods. There was nothing at all that we would find obscene in the book; it simply described and recommended methods of birth control. The most striking application of this approach was the practice, almost universally adopted, of denying an adulterous wife not merely custody of, but even access to her children. As Sir Cresswell Cresswell said in 1862 it would "have a salutary effect in the interests of public morality that it should be known that a woman, if found guilty of adultery, will forfeit, as far as this Court is concerned, all right to the custody of, or access to her children".

Nowadays it is very different. He warned: "A secular judge must be wary of straying across the well-recognised divide between church and state." It is, he said, not for a judge to weigh one religion against another, stressing the court recognises no religious distinctions and generally speaking, passes no judgment on religious beliefs or on the tenets, doctrines or rules of any particular section of society.

"All are entitled to equal respect, so long as they are 'legally and socially acceptable' and not 'immoral or socially obnoxious' or 'pernicious', he said.

He cited some cases from as recently as the 1950s in which judges had considered it their duty to enforce 'Christian morality' on people like homosexuals. Now he says such judgements seem "as remote as Ninevah or Babylon".

Strasbourg jurisprudence, he stressed, is to the same effect, forbidding the state to determine the validity of religious beliefs and imposing a duty of neutrality and impartiality.

Munby said:

Judges are no longer custos morum of the people, and if they are they have to take the people's customs as they find them, not as they or others might wish them to be. Once upon a time the perceived function of the judges was to promote virtue and discourage vice and immorality. I doubt one would now hear that from the judicial Bench. Today, surely, the judicial task is to assess matters by the standards of reasonable men and women in 2013 – not, I would add, by the standards of their parents in 1970 – and having regard to the ever changing nature of our world: changes in our understanding of the natural world, technological changes, changes in social standards and, perhaps most important of all, changes in social attitudes... We live, or strive to live, in a tolerant society increasingly alive to the need to guard against the tyranny which majority opinion may impose on those who, for whatever reason, comprise a small, weak, unpopular or voiceless minority. Although historically this country is part of the Christian west and, although it has an established church which is Christian, we sit as secular judges serving a multi-cultural community of many faiths, sworn to do justice 'to all manner of people'. We live in this country in a democratic and pluralistic society, in a secular State not a theocracy. Religion – whatever the particular believer's faith – is not the business of government or of the secular courts, though the courts will, of course, pay every respect to the individual's or family's religious principles. Article 9 of the European Convention for the Protection of Human Rights and Fundamental Freedoms 1950 demands no less. The starting point of the common law is thus respect for an individual's religious principles, coupled with an essentially neutral view of religious beliefs and a benevolent tolerance of cultural and religious diversity. A secular judge must be wary of straying across the well-recognised divide between church and State. It is not for a judge to weigh one religion against another. The court recognises no religious distinctions and, generally speaking, passes no judgment on religious beliefs or on the tenets, doctrines or rules of any particular section of society. All are entitled to equal respect, so long as they are "legally and socially acceptable" and not "immoral or socially obnoxious" or "pernicious."

Terry Sanderson, president of the National Secular Society, said: "This is a most reassuring speech from a very high profile judge. The days of judges using their benches to preach Christianity and claim that the Book of Common Prayer is the basis of British law are gone, and not a moment too soon. The courts must remain secular and provide justice without prejudice for everyone who appears in them."

However, Mr Sanderson said that it was increasingly difficult for judges to avoid making judgements on religious doctrine as more and more claims of religious discrimination were coming before them.

"Having to decide for instance whether it is an Islamic duty for a woman to wear a niqab, as some have claimed, or for a Christian to wear a cross at work even when it poses a health and safety risk, means that judges are being required to rule on doctrinal matters that should be of no concern to them. Living in a diverse society means a secular approach is the only fair one, but it also makes a judge's duty to maintain religious impartiality very difficult."

Read the speech in full (pdf)