The Paris appeal court on Wednesday overturned a lower court's ruling that the Baby Loup creche, which operates in a deprived area of the town of Chanteloup-les-Vignes, near Paris, was guilty of religious discrimination when it sacked Afif, who was deputy director at the time.
It declared that the creche had the right to have its own rules enforcing the "neutrality of the personnel" to "transcend the multiculturalism of the people it aims at", claiming the 1989 convention on the rights of the child protects the freedom of conscience and potential religion of children.
"Today a republican institution has confirmed the principle of secularism," declared Baby Loup's lawyer, Richard Malka.
But Afif's lawyer, Michel Henry, accused the court of "inventing" the requirement to protect children's freedom of conscience and accused some of Baby Loup's supporters of being "close to anti-Islamic xenophobia".
The case has made its way through several levels of the legal system already.
The latest decision comes as the European Court of Human Rights considered an appeal against France's ban on face-covering garments - seen as being aimed at the burka and niqab - in a case brought by a 23-year-old French Muslim woman, known only as SAS.