Education Secretary Nicky Morgan made an "error of law" by leaving non-religious world-views out of the new religious studies GCSE, according to the High Court.
The court's ruling represented a victory for the British Humanist Association, which had supported three families who were party to the case for a judicial review of the qualification. They said the course curriculum failed to reflect in schools the pluralistic nature of the UK.
The new RS GCSE, announced last February, had drawn criticism because it focused on world religions and ignored humanism. The former Archbishop of Canterbury, Rowan Williams, was among 28 religious leaders who urged the Government to include humanism in the curriculum.
The families seeking judicial review included one from Cumbria and one from Kent who cannot be identified.
The third family is Kate Bielby, of Frome, Somerset, and her daughter Daisy.
David Wolfe QC, for the families, told the judge there was widespread concern "about the Secretary of State's failure to comply with her duty of neutrality and impartiality as between religious and other beliefs".
Mr Justice Warby allowed their application for a judicial review, saying that there had been "a breach of the duty to take care that information or knowledge included in the curriculum is conveyed in a pluralistic manner".
Lawyers for the Education Secretary had said that while some schools rely on the RS GCSE to provide religious education for 14 to 16-year-olds, non-religious beliefs can be studied and what is in a school's curriculum is a matter "for local determination" by individual schools.
However, when the decision was made last February to issue new subject content an assertion was made that such a GCSE "will fulfil the entirety of the state's RE duties".
The judge ruled that schools were likely to accept and act on this, saying: "The assertion thus represents a breach of the duty to take care that information or knowledge included in the curriculum is conveyed in a pluralistic manner."
While the humanists have won their case for a judicial review of the course, it is thought unlikely that the court will instruct exam boards to modify its content. According to the BHA, it is more likely to rule that the RS GCSE cannot form the whole of the religious education syllabus at key stage 4 and to demand that the government issues a statement to schools clarifying the situation.