WHITE PLAINS, N.Y. (CBSNewYork) – A federal judge has ruled against a group of local parents who are refusing to vaccinate their children.

More than 40 students have been banned from a private school during the Rockland County measles outbreak. On Tuesday, the judge said he would not lift that ban.

Those students and their families were in a courtroom instead of a classroom, fighting an order to stay away from fellow students due to the high risk they could contract and spread the measles.

MORE: Unvaccinated Child Nearly Dies Of Tetanus, Family Ends Up With $1 Million Medical Bill

The controversial parents said the ban was doing more harm than good.

“Preventing my child from being with his class, his teacher, his classroom has had a significant social and psychological impact,” one mother who wouldn’t give her name claimed.

The unidentified parent added her youngster has missed 90 days of class at the private Green Meadow Waldorf School in Rockland County.

Rockland County parents who refuse to vaccinate their children stand outside court on Tuesday, March 12. (Credit: CBS2)

The school says 83 percent of students are vaccinated for measles due to several families’ religious objections. The Rockland County health department’s so-called “exclusion order” applies to schools with less than 95 percent vaccination level.

In December, the county health commissioner ordered unvaccinated children at 60 private schools in two zip codes to stay home until a severe measles outbreak ended.

Green Meadows families sued, saying the “exclusion order” was too broad and should not apply to schools that have no current measles cases.

“I do not believe state law gives the authority to the public health commissioner of the county or the state to exclude children from school where there is no reported case of measles in the specific school,” attorney Michael Sussman said.

MORE: Major New Study Finds No Link Between Vaccines And Autism

Judge Vincent Briccetti disagreed, saying the exclusion order to protect public health was “neither arbitrary nor outrageous.”

 “We have to stand strong for the protection of the babies and the infirm who would be affected by this disease,” Rockland County attorney Thomas Humbach added.

Some Green Meadows parents have hired tutors. Others have arranged for their children to watch livestreams from the classrooms they can’t attend. A handful have relented and had their kids vaccinated.

Most of the impacted schools in Rockland are yeshivas.