Led by Green party mayor Eric Piolle, Grenoble in May changed its swimming pool rules to allow all types of bathing suits and for women to bathe topless, where previously only traditional swimming costumes for women and trunks for men were authorised.
"All we want is for women and men to be able to dress how they want," Piolle said at the time.
The judges disagreed, finding that "contrary to the objective declared by the city of Grenoble, the change to the pool rules aimed only to authorise wearing of the 'burkini'".
Piolle did not immediately respond to AFP's request for comment on the court ruling.
Tuesday's court decision was "a victory for the law against separatism, for secularism and beyond that, for the whole republic," Interior Minister Gerald Darmanin wrote on Twitter, referring to a law introduced last year to counter Islamic fundamentalism.
France's treatment of Islam is likely to remain a political battlefield following Sunday's inconclusive parliamentary election that denied President Emmanuel Macron an absolute majority in parliament.
Voters handed the anti-immigration, anti-Islam National Rally an unprecedented 89 seats, while the more mainstream Republicans conservative party is seen as the only possible partner for Macron to reach a governing deal or pass laws on a case-by-case basis.
Republicans lawmaker Eric Ciotti called on Twitter Tuesday for the burkini to be "clearly banned by law".
Fighting on the beaches
Attempts by several local mayors in the south of France to ban the burkini on Mediterranean beaches in the summer of 2016 kicked off the first firestorm around the bathing suit.
The restrictions were eventually overturned -- also by the Council of State -- for being discriminatory.
Limited to Grenoble, the latest ruling "has not at all called into question its block on banning the burkini" back then, said Patrice Spinosi of the Human Rights League (LDH), which backed the city's authorisation of the swimwear.
"This decision is only relevant to the specific situation in Grenoble and shouldn't be generalised".
Burkinis are not banned in French state-run pools on religious grounds, but for hygiene reasons, while swimmers are not under any legal obligation to hide their religion while bathing.
Grenoble is not the first French city to change its rules.
The northwestern city of Rennes quietly updated its pool code in 2019 to allow burkinis and other types of swimwear.