A fundamental principle of modern secular societies is religious freedom—specifically, the right of citizens to choose their own religious beliefs.
However, there are certain prerequisites:
1. The religion must be legal. This refers to the state's general religious policies rather than regulations targeting any specific religion.
2. Citizens must possess full civic autonomy before they can independently choose a religion.
This gives rise to an issue: minors do not possess full civic autonomy. Consequently, their religious beliefs are effectively determined by their families, environments, or guardians, rather than by their own choices.
For this reason, in many secular nations, the involvement of minors in religious matters is strictly restricted or even prohibited.
If we view the hijab as a religious matter for Muslims, then it does indeed present an issue in schools within secular states, given that the individuals involved are minors.
But,
if a country were to ban only Muslims from wearing the hijab while permitting other religious symbols among minors, then I would agree that this constitutes textbook religious discrimination.
But if they were to simultaneously prohibit all minors from engaging in religious practices, then I—as a secularist—would find that acceptable.