Update - 12.12pm: A gay priest prevented from working as a hospital chaplain after marrying his partner has lost an Appeal Court challenge over his discrimination claim.
Canon Jeremy Pemberton, a Church of England priest for more than 30 years, had his permission to officiate revoked after he married Laurence Cunnington in April 2014.
He was also denied a licence to officiate in the diocese of Southwell and Nottingham, which left him unable to take up a job offer at the King's Mill Hospital in Sutton-in-Ashfield.
Canon Pemberton brought an employment tribunal against the former acting Bishop of Southwell and Nottingham, the Rt Rev Richard Inwood, but his claims of discrimination and harassment were dismissed - a decision upheld by the employment appeal tribunal in 2016.
He renewed his fight at London's Court of Appeal, where his lawyers argued that the tribunal decisions should be overturned.
But, in a written ruling on Thursday, Lord Justice Underhill and two other judges found the bishop's decision was lawful under the Equality Act.
The judge said: "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.
"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.
"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."
Earlier: A gay priest prevented from working as a hospital chaplain after marrying his partner will learn the outcome of an Appeal Court challenge in England over his claim he was discriminated against.
Three leading judges are expected to deliver a ruling today in the case of Canon Jeremy Pemberton, who had his permission to officiate revoked after he married Laurence Cunnington in April 2014.
Canon Jeremy Pemberton, a Church of England (C of E) priest for more than 30 years, was also denied a licence to officiate in the diocese of Southwell and Nottingham - which left him unable to take up a job offer at the King's Mill Hospital in Nottinghamshire.
He lost an employment tribunal against the Rt Rev Richard Inwood, former acting Bishop of Southwell and Nottingham, and his claims of discrimination and harassment were also rejected by the employment appeal tribunal.
But he renewed his fight at London's Court of Appeal, where his lawyers argued the earlier rulings should be overturned.
During a two-day hearing in January, his legal team said the bishop's decisions were wrong, because the C of E has no fixed rule on same-sex marriage among members of the clergy.
His barrister Sean Jones QC also said C of E clergy members in civil partnerships were allowed to officiate and that those were "effectively indistinguishable" from same-sex marriages.
He added: "There isn't a doctrine that says if you have entered into a same-sex civil marriage, then you cannot officiate."
Lawyers for the former bishop said it was accepted Canon Pemberton felt "humiliated" by the decisions, but the tribunal was right to find there was no "homophobic harassment".
Thomas Linden QC told the court the decisions were taken on the grounds Canon Pemberton had "publicly flouted the doctrines of the Church on marriage, whereas his duty as a priest was to exemplify them".
He added: "As a result, he remained a priest and he was perfectly entitled to remain a member of the Church, to continue to participate in the life of the Church, and indeed to continue to argue for a change in the Church's position on same-sex marriage.
"But he did not have permission to officiate in the diocese of Southwell and Nottingham."