My personal opinion on the matter is that any member of a armed force is representative of their nation, and the service, and as such should conduct themselves with a proper level of decorum, both while wearing the uniform and not. I do realize that it is unrealistic to expect a soldier to strictly adhere to strict behavioral codes while on leave and such, but even then they should not go do crazy shit (such as getting drunk and doing very stupid things, [note: this is a actual article of Courts Martial (article 134 section 73, to those who care))] or running through the streets naked).
While on duty, however, I strongly feel that they should show such proper behavior. While on duty they should also wear the uniform, in its entirety, properly. This would rule out kilts I am afraid. As a soldier (and possibly officer) you should take pride in wearing your uniform, and in it being in good order. Off duty (but still on ship or other military facility) things could be more lax, but only to a certain degree.
So I have to say that, yes, pants are a must (or skirts, for females, if they so wish) imo for any soldier or officer while on duty (or off duty, if the other option is running about the ship/base in their underwear).