Mayor Gilles Platret announced in March that pupils in his town of Chalon-sur-Saone near Dijon in eastern France would no longer be guaranteed a non-pork option at lunchtime from the start of the next school year in September.
It triggered controversy across the country, including within his Republican party, led by former president Nicolas Sarkozy.
Education Minister Najat Vallaud-Belkacem accused Platret of "taking children hostage" with his politics.
A legal complaint was filed by the Muslim Judicial Defence League, whose lawyer, Karim Achoui, said "a child would be extremely traumatised if a pork cutlet was served to him and he was obliged to eat it after he has been repeatedly told from a young age that it's forbidden food."
'Integration not assimilation'
Another member of the group, Jean-Baptiste Jacquenet-Poillot, said the removing of non-pork options was a breach of France's stringent laws on secularism, which were about "integration, not assimilation".
The mayor's lawyer responded in a statement to the court that the laws on secularism did not oblige authorities to "provide everyone what they need to exercise their religion".
But many see the decision as pandering to anti-immigrant sentiment at a time of heightened tensions over jihadist attacks.
Last year, far-right leader Marine Le Pen said schools would no longer offer non-pork alternatives in towns that elected her National Front party.
Platret has argued that 40 percent of children in the town's schools did not eat meat at all because it was not halal, and made up for it with extra vegetables.
Alternatives to pork have been offered in the town's schools -- as they are across much of France -- since 1984.
France is thought to have the largest Muslim and Jewish populations in Europe, although its secularism laws prevent the government from collecting data on religious affiliation.
In 2014 Marcel Mortreau,the mayor of Sargé-lès-Le Mans in the Sarthe department of north-western France also told Muslim and Jewish pupils that it was "pork or nothing".
Mortreau said his decision was based on the “principle of Republican neutrality”.
“The mayor is not required to provide meals that respond to religious requirements. This is the principle of secularism,” Mortreau told Europe1 radio.
The Town Hall has also backed its decision on the grounds of logistics claiming its new school meals provider has complained about the extra workload that comes with providing alternative meals when pork is on the menu.