A Christian couple opposed to homosexuality have lost a battle over their right to become foster carers.
Eunice and Owen Johns, 62 and 65, from Derby, said the city council did not want them to look after children because of their traditional views.
The pair, who are Pentecostal Christians, say they were "doomed not to be approved".
The High Court ruled that laws protecting people from sexual discrimination should take precedence.
The Pentecostal Christian couple had applied to Derby City Council to be respite carers.
They withdrew their application after a social worker expressed concerns when they said they could not tell a child a homosexual lifestyle was acceptable.
At the High Court, they asked judges to rule that their faith should not be a bar to them becoming carers, and the law should protect their Christian values.
But Lord Justice Munby and Mr Justice Beatson ruled that laws protecting people from discrimination because of their sexual orientation "should take precedence" over the right not to be discriminated against on religious grounds.
They said that if children were placed with carers who objected to homosexuality and same-sex relationships, "there may well be a conflict with the local authority's duty to 'safeguard and promote the welfare' of looked-after children".
They rejected suggestions that the case involved "a threat to religious liberty", adding: "No one is asserting that Christians - or, for that matter, Jews or Muslims - are not fit and proper persons to foster or adopt. No-one is contending for a blanket ban."
Speaking outside the court in London, Mrs Johns said: "All we wanted was to offer a loving home to a child in need. We have a good track record as foster parents.
"We have been excluded because we have moral opinions based on our faith and we feel sidelined because we are Christians with normal, mainstream, Christian views on sexual ethics.
"We are prepared to love and accept any child. All we were not willing to do was to tell a small child that the practice of homosexuality was a good thing."
The couple, who cared for about 15 children in the 1990s, have called for a public inquiry into the matter.
Derby City Council has welcomed the court's ruling.
A spokesman said the authority "valued diversity and promoted equality" and "encouraged and supported children in a non judgmental way, regardless of their sexual orientation or preference".
He added: "The court confirmed that the local authority is properly entitled to consider a prospective foster carer's views on sexuality when considering their application to become a foster parent and in fact, failure to do so would potentially leave it in breach of its own guidance as well as the National Minimum Standards."
Ben Summerskill, chief executive of Stonewall, the lesbian, gay and bisexual charity, said: "Thankfully, Mr and Mrs Johns' out-dated views aren't just out of step with the majority of people in modern Britain, but those of many Christians too.
"If you wish to be involved in the delivery of a public service, you should be prepared to provide it fairly to anyone."
But the Christian Legal Centre reacted to the ruling with dismay and warned that "fostering by Christians is now in doubt".
The organisation said the judgment "sends out the clear message that orthodox Christian ethical beliefs are potentially harmful to children and that Christian parents with mainstream Christian views are not suitable to be considered as potential foster parents".