There's more to the term "military science fiction" than just having characters who are members of a military organization. It generally entails a focus on war and combat with a detailed examination of military technology, strategy, and tactics, an emphasis on military values and the experiences of soldiers or officers in wartime, etc.
This. Star Trek is not really as a whole military science fiction. I wouldn't like it very much if it was, just like I don't like war movies/shows.
I don't say either that it can't or should not explore the genre every now and then, Star Trek as a setting (that's what it is in my mind) holds room for every kind of scifi if the author/screenwriter/director wants to tell it. The Siege of AR-558 is a perfect example for military scifi within trek, as is "Balance of Terror".
Few of the characters in Star Trek even exhibit a military mindset, behavior or characteristics, even the rebellious Marquis rebels in Voyager went back to being happy, prim-and-proper scholars and scientists once Janeway had them out of their fatigues.
With very, very few exceptions (Jellico comes to mind) Starfleet officers are not modeled after actual military personnel but rather hark back to the romantic ideal of the cultivated, highly scientific military scholar of the Golden Age of Sailing who was equal parts fighter, diplomat and scientist (you know "I am the very model of a modern Major-General/I have information vegetable, animal and mineral...)
I think Star Trek is technically military science fiction, but it plays down the elements seen in most military science fiction (see Starship Troopers, Battlestar Galactica, or any Stargate for more militaristic military sci fi).
The only real difference between Star Trek and those shows is that Trek has producers trying to actively deny Starfleet is a military, while the others honestly admit their organizations are military.
No, there is worlds of difference:
Star Ship Troopers is all about the experience of the front-line grunt during warfare and is just a ugly and brutal as such things ought to be, let alone the highly militaristic mindset of the general populace.
Just take the scene where they all decide to get the same tattoo to showcase alliance to their unit, can you imagine such a scene in a Star Trek medium? In my eyes it would go against the general cosy, highly individual and sophisticated air Starfleet is presented in the TV shows.
Battle Star Galactica (I assume 20 fridge meant the re-imagined series) also focused more on the "hard" and "ugly" side of the military. Grey and Black morality, "though" choices and people who were broken beyond repair by the things they have seen and have been forced to do. It was pretty much "the Iraq War in Space", at least judged by the little I have seen of it and read about it.
Can you imagine someone like Starbuck in Star Trek? People like to compare her to Yar, yet the only thing they have in common is blonde hair and a military background. Can you imagine Tasha acting as low or pragmatic as Starbuck?
Star Gate, however, despite having its characters run around in fatigues is actually not much more militaristic than Star Trek (at least what I remember of it, it has been years and years) What I remember a lot of its characters were scientists and the stories focused mainly on exploration, archeology, planets of the week, mysteries found on the other side of the gate etc, with the occasional armed conflict, just like it Trek. Aside from being contemporary, largely planet bound and having that "Ancient Astronauts" angle you could argue its remarkably similar To trek, so I would not call it military scifi either.