Friday's court case stemmed from a Muslim woman who was sacked from her job without pay in 2001 from one of Dansk Supermarked's stores because she wished to wear a headscarf at work.
Denmark's High Court ruled that the store was entitled to dismiss the woman as it is part of a general ban on headgear for employees in customer-facing roles at the group's four supermarket chains.
"The legislator has weighed the right of an employer to demand a uniform or a certain dress code over consideration for an employee who for religious reasons is unable to adhere to dress rules," the court said in a statement.
There is no official prohibition in Denmark on wearing headscarves or other religious dress in public places and schools, but other countries have banned such symbols.
Strictly secular France imposed a controversial ban on headscarves and other religious symbols in its schools last September. The ban met with protests but has generally been observed.