The education secretary made "an error of law" when she left "non-religious world views" out of the new religious studies GCSE, the High Court has ruled.
The ruling was a victory for three families, supported by the British Humanist Association (BHA), who claimed Nicky Morgan had taken a "skewed" approach and was failing to reflect in schools the pluralistic nature of the country.
Allowing their application for judicial review, Mr Justice Warby, sitting in London, ruled 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".
Changes to RS GCSE subject content were announced last February, leading to complaints over the priority given to religious views, including Buddhism, Christianity, Hinduism, Islam, Judaism and Sikhism.
Earlier this year, the former Archbishop of Canterbury Rowan Williams was among 28 religious leaders who urged the government to rethink plans to leave humanism out of the new qualification.
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 at a recent hearing that 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".
Lawyers for the education secretary said neither domestic law nor the European Convention on Human Rights require equal consideration to be given to religious and non-religious views in the curriculum.
They argued that, although some schools rely on the RS GCSE to discharge their duty to provide religious education at key stage 4 for 14 to 16-year-olds, provision has been made for non-religious beliefs to be studied and what is in a school's curriculum is a matter "for local determination" by individual school authorities.
Ruling in favour of the humanists, the judge said: "It is not of itself unlawful to permit an RS GCSE to be created which is wholly devoted to the study of religion." But when the decision was reached 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 said that was an assertion likely to be accepted and acted on by schools and their governing authorities.
"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."
As a result, he concluded that the education secretary "has made an error of law in her interpretation of the education statutes".
Want to keep up with the latest education news and opinion? Follow TES on Twitter and like TES on Facebook