Catholic Care, which serves the dioceses of Leeds, Middlesbrough, and Hallam in South Yorkshire, claimed it would be forced to stop its work finding homes for children if it had to comply with the legislation.
Other Catholic adoption agencies have either given up adoption or severed their ties with the Church because of the rules, which were introduced in 2007.
Catholic Care had sought an exemption under the Sexual Orientation Regulations to allow it to continue to operate as it had always done, but its attempt was opposed by the Charity Commission.
Mr Justice Briggs, sitting at the High Court in London, allowed the society's appeal and ordered the commission to reconsider its case.
The verdict was welcomed by Catholic Church authorities, but was met with dismay by gay-rights campaigners and secular groups.
The Bishop of Leeds, the Right Rev Arthur Roche, said outside the court: "Our case has not been brought on an anti-gay agenda of any sort. We respect, and would not want to diminish, the dignity of any person."
But Jonathan Finney, the head of external affairs at Stonewall, the gay-rights charity, condemned the judgment: "It's unthinkable that anyone engaged in delivering any kind of public or publicly funded service should be given licence to pick and choose service users on the basis of individual prejudice.
"It's clearly in the best interests of children in care to encourage as wide a pool of potential adopters as possible. There should be no question of discriminatory behaviour by any organisation that benefits from the taxpayer."
Terry Sanderson, the president of the National Secular Society, said: "This is an alarming decision and the first major setback for the protection of gay people from discrimination by religious groups."
Catholic Care is the last of the Catholic adoption agencies to continue its fight against the Sexual Orientation Regulations.
The Catholic Church lost a battle against the regulations when they were introduced in 2006.
The agencies were given a 21-month transition period to adjust to the new regulations and by January last year, five had cut their formal ties with the Church to comply with the rules.
The Catholic Children's Society in Westminster decided to end its work with the Father Hudson's Society in the Archdiocese of Birmingham, and announced it was "demerging" its adoption recruitment and assessment into a separate charity after an unsuccessful appeal to the Charity Commission.
In a statement, Bishop Roche said: "The judgment today will help in our determination to continue to provide this invaluable service to benefit children, families and communities.
"We look forward to producing evidence to the Charity Commission to support the position that we have consistently taken through this process: that without being able to use this exemption, children without families would be seriously disadvantaged."
Caritas Social Action Network, the umbrella network for Catholic care agencies, said an important principle had been upheld about how faith-based groups could work with public authorities.
"By requiring the Charity Commission to review its decision, the court has upheld the legitimate freedom of charities to organise themselves in such a way that their activities reflect their religious ethos when justified in the public benefit, as we believe is the case in this instance."
The Charity Commission was ordered by the judge to pay Catholic Care's legal costs, unofficially estimated at more than £100,000. Lawyers acting for the adoption agency worked pro bono for a further £55,000.
The Charity Commission said it had noted the judgment.
It said: "The High Court has overturned the tribunal's decision and has remitted the case to the commission to decide whether Catholic Care should be permitted to adopt the proposed objects."
+++++++++++++++++++++++++++++++++++++++++++++
Disclaimer
No responsibility or liability shall attach itself to us or to the blogspot ‘Clerical Whispers’ for any or all of the articles placed here.
The placing of an article hereupon does not necessarily imply that we agree or accept the contents of the article as being necessarily factual in theology, dogma or otherwise.
SIC: TIUK