But Scotty did wear his kilt on duty, with his uniform.
Are you saying this is OK but a secularist Muslim wearing a hijab as a cultural artifact would not be? Why are you OK with Christian hymns and Christmas celebrations being secular in the 23rd century but Islamic customs not being given the same pass?
This all seems like a double standard, and you have not been making factual claims with respect to Star Trek canon.
Side note, I kind of wonder if military uniforms and dress codes will survive into the 23rd century. I am thinking probably not.