A gay Anglican priest who was stripped of his license to work as a chaplain after he went against Church of England rules and married his partner in 2014 lost his discrimination case.
Lord Justice Underhill declared at London's Court of Appeal on Thursday that Canon Jeremy Pemberton knew full well that he was breaking the CofE's rules against priests in same-sex marriages when he married Laurence Cunnington in April 2014.
"I have no difficulty understanding how profoundly upsetting Canon Pemberton must find the Church of England's official stance on same-sex marriage and its impact on him," Underhill said in his written decision.
"But it does not follow that it was reasonable for him to regard his dignity as violated, or an 'intimidating, hostile, degrading, humiliating or offensive' environment as having been created for him, by the Church applying its sincerely-held beliefs in a way expressly permitted by Schedule 9 of the (Equality) Act," he added.
"If you belong to an institution with known, and lawful, rules, it implies no violation of dignity, and it is not cause for reasonable offence, that those rules should be applied to you — however wrong you may believe them to be.
"Not all opposition of interests is hostile or offensive."
Pemberton sued former acting Diocesan Bishop, the Rt. Rev. Richard Inwood, after he was denied a license to officiate in the diocese of Southwell and Nottingham, which led to him losing out on a job offer at the King's Mill Hospital in Sutton-in-Ashfield.
The Church of England bars priests from getting married to same-sex partners, and defines marriage as a union solely between one man and one woman.
Pemberton reacted to the Court of Appeal decision by claiming that the CofE is now being allowed to "continue to discriminate legally against LGBT people in relation to their employment."
"This will seem to most people in the U.K. today an extraordinary result, and not one that will help commend the claims of Christ to the nation. An official position that regards the loves and commitments of LGBT people, including clergy, as sinful is years overdue for thorough-going revision," the priest wrote on his website.
"The need for a revolution in attitudes and practices in the Church towards this minority is still acute — we continue to wait for real change."
The Diocese of Southwell and Nottingham, meanwhile, welcomed the court's ruling.
"Churches across the diocese continue to offer a generous welcome to people from all backgrounds and we remain fully engaged in the Church's exploration of questions relating to human sexuality," it said in a statement on its website.
"The Church of England supports gay men and women who serve as clergy in its parishes, dioceses and institutions. It has no truck with homophobia and supports clergy who are in civil partnerships, as set out in the House of Bishops guidelines in 2006," it continued.
"We recognize that it has been a long and difficult process for all those concerned, and we hold them in our thoughts and prayers."
Back in 2014, Pemberton became the first CofE priest to openly defy the ban on gay clergy marrying, stating that he is the same as anyone else "who wants to get married."
Conservative voices, such as the Reform evangelical group, urged the church body not to change its stance on the issue despite pressure.
"There's no doubt that there is pressure within some parts of the church for the church to change its mind on sexuality," said the Rev. Preb Rod Thomas, Reform's chairman, at the time.
"If there is not clear discipline then it is the equivalent to saying 'we really didn't mean what we said.' It will precipitate a crisis," he warned.