The education secretary made "an error of law" in leaving "non-religious world views" out of the new religious studies GCSE, the High Court has ruled.
This was because Nicky Morgan asserted this GCSE would cover the state's legal duty to provide religious education.
Three families argued she had taken a "skewed" approach to RS when she had announced changes in February.
Mr Justice Warby ruled there had been "a breach of the duty" in reflecting the pluralistic nature of the UK.
The government said its new GCSE was found to be lawful and that it aimed to promote an understanding of all beliefs.
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 he added the February announcement had included the "assertion" the new GCSE "will fulfil the entirety of the state's [religious education] duties" and schools would interpret this to mean non-religious views need not be included in teaching.
"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," he said.
And as a result, the education secretary "has made an error of law in her interpretation of the education statutes".
A Department for Education spokesman said: "We will carefully consider the judgement before deciding on our next steps.
"Our new RS GCSE ensures pupils understand the diversity of religious beliefs in Great Britain through the study of more than one religion, an important part of our drive to tackle segregation and ensure pupils are properly prepared for life in modern Britain.
"It is also designed to ensure pupils develop knowledge and understanding of both religious and non-religious beliefs.
"Today's judgment does not challenge the content or structure of that new GCSE, and the judge has been clear it is in no way unlawful.
"His decision will also not affect the current teaching of the RS GCSE in classrooms."
If the judgement is not successfully challenged, by the Department for Education, schools will have to ensure non-religious content is covered at GCSE from 2016 when the new curriculum is being introduced.
Mrs Morgan's changes sparked complaints from 28 religious leaders, including the former Archbishop of Canterbury, Lord Williams, who urged the government to rethink its decision to prioritise religious beliefs in particular those associated with:
- Catholic Christianity
The families seeking judicial review included one from Cumbria and one from Kent who cannot be identified. The third family is Kate Bielby from Frome in Somerset, and her daughter Daisy.
The families were backed by the British Humanist Association, which interprets the ruling differently from the DfE.
It described the ruling as a "triumph" in its efforts to ensure parity was given to humanism as an example of a non-religious worldview.
BHA chief executive Andrew Copson said it had made the case for many decades that the school curriculum on religions should include major non-religious worldviews such as humanism.
"This is a stunning victory for the three humanist families who stood up to the government on this issue.
"It is also a victory for the vast majority of people who believe in the importance of a religious education curriculum that is inclusive, balanced, and pluralistic, and which contributes to mutual understanding between people of all religions and none.
"We look forward to working with the government to ensure that the changes required by the judgement are implemented and hope they will use this as an opportunity to improve the GCSE for the benefit of all children."