A Berlin-based Islamic group had complained about the law, which authorities in the conservative-run state of Bavaria have used to ban head scarves while allowing Roman Catholic nuns to continue to wear their habits in schools.
However, the Bavarian Constitutional Court ruled Monday that the application of the law in the southern state neither violated religious freedoms nor was discriminatory, the AP says.
Under Germany's federal system of government, education is almost totally under the control of authorities in its 16 states. Authorities in several of them, including Baden-Wuerttemberg and Hesse, have introduced similar head scarf bans.
A lawyer for the Islamic Religious Community, the plaintiff in the Munich case, said some of its members were considering an appeal to the Federal Constitutional Court, Germany's highest.