(CNN) -- Massachusetts' highest court ruled Friday that the Pledge of Allegiance does not discriminate against atheists, saying that the words "under God" represent a patriotic, not a religious, exercise.
All previous attempts to eliminate the mention of God in the pledge recited in classrooms across the country have failed, but the Supreme Judicial Court of Massachusetts considered arguments seeking removal of the reference based on discrimination.
The case was brought by an unidentified family of a student at a school in suburban Boston, whose lawyers argued that the pledge violates the Equal Rights Amendment of the state Constitution. It was the first such case at the state level.
Roy Speckhardt, the executive director of the American Humanist Association, an atheist group that provided legal services for the plaintiffs, called the decision a setback. But he said the group felt confident about a similar case filed in New Jersey last week that seeks to show that the pledge engendered a climate of discrimination.
In its ruling, the Massachusetts court said the pledge was voluntary and a "fundamentally patriotic exercise, not a religious one."
The decision said the plaintiffs failed to prove that reciting the pledge resulted in negative treatment.
"The plaintiffs here did not successfully allege that their children receive negative treatment because they opt not to recite the words 'under God,' or that the inclusion of that phrase in the pledge has occasioned 'the creation of second-class citizens,' " the decision said.
But the ruling said that "should future plaintiffs demonstrate that the distinction created by the pledge as currently written has engendered bullying or differential treatment," the court "would leave open the possibility that the equal rights amendment might provide a remedy."
Speckhardt said that the recitation of the pledge resulted in some children being "ostracized" for being atheists and that the government was complicit in bullying and prejudice against those children.
In 1954, Congress amended the pledge to include the words "under God" during the escalation of the Cold War.
The Massachusetts Supreme Judicial Court has high-profile and precedent-setting experience deciding cases hinging on the Equal Rights Amendment of the Massachusetts Constitution. In 2003, Massachusetts became the first state to legalize same-sex marriage with the Supreme Judicial Court's landmark Goodridge decision.