There are very few militaries that don't have uniform and appearance standards and regulations.
Of course, every military has regulations of some sort. However, the the actual regulations itself and the amount with which they are enforced tend to differ. Not only that, but aside from the times we did see certain regulations enforced, we've also seen a large amount of cases where strange or unpractical haircuts and improper uniforms have been allowed in Starfleet. As such, ascribing the regulations of a current-day military to Starfleet seems a bit strange.
You said "the military usually lets haircuts be as you like". I proved that to be false. Then you claim starfleet had no uniform and appearance standards. I pointed out that they do and we've seen them enforced several times. Seeing some one with adaptations to their starfleet uniform or hair style does not mean there are no regulations. Waivers were made for people like Scotti, Worf, Ro .. ect. So anyone we see in the background who appears to be out of uniform, obviously the character has had such issues wavered in regard to either their religion or cultural tradition. That is something that happens in today's military to an extent in non combat environments.
The point is : You have no argument.
Seeing someone who is slightly out of uniform does not mean that the orginaziton for which they wear the uniform is not military.