The move by high schools was a bid to stop pupils crowding on pavements to grab a quick smoke between classes, which authorities and some parents feared would make them a target for potential attacks.
The Paul Lapie high school in Courbevoie is one of three taken to court by anti-smoking groups, who are up in arms at teenagers being given the right to smoke in schools a decade after it was banned.
The administrative court said the school's principal must "ensure the respect of public health laws banning smoking in school establishments."
Shortly after the November 13th attacks on Paris nightspots and the national stadium which left 130 dead, the Islamic State group issued threats against French schools.
Under the state of emergency imposed after the attacks, a circular signed by both the education ministry and interior ministry was sent to schools urging them to avoid having pupils gather outside their premises.
Some schools then sent out letters to parents about new dedicated smoking areas, even specifying that ashtrays would be provided.
However the official rules have been clouded with confusion, with conflicting guidelines from the education ministry.
Education Minister Najat Vallaud-Belkacem said last week that "during this period of heightened security, high school students must simply be asked not to smoke".
"According to the minister it is a difficult balance and we must remain pragmatic," a spokeswoman at the education ministry told AFP earlier this week.
A study in June 2015 showed that one in three 17-year-olds smoke daily in France.
The mother of a 16-year-old boy in the central city of Lyon, who is also a lung specialist, has filed criminal charges against his school in a separate case.
She told AFP that security fears were "not a reason to let them smoke inside. We are not going to let them bring a bottle of vodka inside because it is dangerous to drink on the pavement."
The group Non-Smokers' Rights (DNF), which filed the complaints against the three schools, slammed schools for "making smoking seem normal again."