The underlying issue is that of many separate systems of law, only one of which is democratic.
In most cases religious and secular law agree, but in a tiny minority of cases they don't.
Religious law is held to be 'higher' than secular law by various churches and their priests.
A public official is expected to be the public face of secular law (their employers are ultimately the secular lawmakers after all)
If a public official wears religious garb at work, then there is a visible conflict of interest when dealing with issues where secular and religious law might disagree.
This is the chain of logic that leads to such bans.