Christians and other faith groups do have the right to manifest their religious beliefs in the workplace but it is a right that must be balanced against the rights of others.

That conclusion, reached by the European court of human rights in response to claims brought against the British government by four individual Christians, should come as no surprise. But the detailed ruling shows how difficult it was for the seven Strasbourg judges who heard the claims to apply this broad principle to the cases they were deciding.

Take the case of Lilian Ladele, the registrar of births, deaths and marriages who lost her job when she refused to conduct civil partnership ceremonies. By a majority of five votes to two, the Strasbourg judges dismissed her claim that she had suffered discrimination in comparison to a registrar with no religious objection to same-sex unions.

That was because the local authority for which she worked also had a legitimate duty to protect the rights of same-sex couples. The human rights court generally allows member states a wide discretion — what it calls a "margin of appreciation" — when it comes to striking a balance between competing rights. According to the five judges in the majority, the decision to sack her was within that discretion.

But look at what the two minority judges — from Montenegro and Malta — had to say. Recalling that civil partnership ceremonies did not exist in 2002 when Ladele became a registrar in London, the judges found that "a combination of back-stabbing by her colleagues and the blinkered political correctness of the Borough of Islington (which clearly favoured 'gay rights' over fundamental human rights) eventually led to her dismissal".

Minority judgments are written by the judges themselves, unlike the majority ruling which is compiled by officials. The court itself would never have said that gay rights were not human rights.

Nadia Eweida, a check-in operator for British Airways, was the only one of the four applicants to win her case — again by a majority of five votes to two. This time it was the British and the Icelandic judges who would have rejected her claim. They thought the court of appeal in London had been right to dismiss Eweida's earlier appeal, given all the facts. She had started her job in 1999 and wore a small cross beneath her uniform without any difficulty until 2006.

Eweida was sent home without pay between September 2006, when she refused to remove or conceal her cross, and February 2007, when British Airways changed its policy and allowed her back. The Strasbourg judges awarded her 2000 euros in compensation for her anxiety, frustration and distress. The government was also ordered to pay towards her legal costs.

Ironically, one reason the court found in Eweida's favour was that British Airways had changed its policy so readily. "The fact that the company was able to amend the uniform code to allow for the visible wearing of religious symbolic jewellery," it said, "demonstrates that the earlier prohibition was not of crucial importance".

But the main reason she won her case was that the balance came down in her favour. "On one side of the scales was Ms Eweida's desire to manifest her religious belief… On the other side of the scales was the employer's wish to project a certain corporate image." In Strasbourg's view, the UK courts had given the latter aim too much weight. BA staff could already wear turbans and hijabs without any negative impact on the airline's brand or image.

In Eweida's case, there was "no evidence of any real encroachment on the interests of others". Contrast that with the case of Shirley Chaplin, a nurse who had worn a cross at work without any difficulty until V-necked tunics were introduced in 2007. Hospital managers feared that a disturbed patient might grab the chain on which it was worn or that the cross might swing forward and come into contact with an open wound.

Tempting though it must have been for the court to dismiss these arguments as fanciful, the court deferred to the domestic authorities. "The reason for asking her to remove the cross, namely the protection of health and safety on a hospital ward, was inherently of a greater magnitude than that which applied in respect of Ms Eweida," the court said.

Finally, the court dismissed a claim by Gary McFarlane, who refused to counsel same-sex couples after joining an organisation that he knew did not discriminate on grounds of sexual orientation. The balance struck between his rights and the rights of the gay couples came within the UK's broad margin of appreciation.

At the most basic level, the ruling shows that there is no easy way of balancing the rights of gay people and the rights of Christians: it all depends on the circumstances. In one sense, the balance is shifting towards Christians: as far as I can see, Eweida's victory is the first defeat for the UK in a case brought under article 9 of the human rights convention, the right to freedom of thought, conscience and religion.

This judgment also strengthens the protection provided by article 9. In the past, the court has held that there was no breach of an employee's religious freedom — from, say, having to work on the sabbath — if the worker could resign and find another job. That was something of a cop-out. Now, says the court, "the better approach would be to weigh that possibility in the overall balance when considering whether or not the restriction was proportionate". Judge Bratza, the court's British former president, went further and said that earlier decisions to the contrary should not be followed.

Adam Wagner, the barrister and blogger, suggested on Twitter that there was "perhaps a whiff of tokenism in Eweida's win". It was "the most convincing case, but still should probably have been left to the UK courts".

Liberty, which supports human rights for all, tweeted that the court had been right to find for Eweida and equally rightis to dismiss the other three claims.

The court's conclusion is certainly very convenient. It has supported the right to manifest one's religion — but against the rights of an employer rather than against the rights of individuals. It did so, in one case, after the employer had changed its policy, implicitly accepting that the former restrictions could not be justified. But, in the other case involving the wearing of a cross, it supported an employer which had sought to justify its policy.

In the two remaining cases, the court has not favoured Christians over gay people. But in stressing that member states have a wide discretion in striking a balance between conflicting rights, it allows for the possibility that future disputes will be decided in favour of religious groups.

It even produced a complicated judgment within four months. Whether you agree with the court's findings or not, you have to give it some credit for sensitivity and shrewdness.