From a recent Forgotten Trek essay:
Essentially, Starfleet officers are often seen exercising powers that in the real world would be controlled by civilian governments. Of course, much of this is simply due to the necessities of television - the characters with whom we're familiar have to be the driving force of most of the plots even if it doesn't make diagetic sense. Still, food for thought.
Starfleet has a military chain of command, military ranks, military uniforms and it carries out military missions. Yet Picard insists in “Peak Performance”, when he objects to participating in a wargame, that “Starfleet is not a military organization. Its purpose is exploration.”
Gene Roddenberry modeled Starfleet on the merchant marine. Nichelle Nichols called it the “philosophical descendant” of NASA. Even Nicolas Meyer, who brought the most militaristic attitude to the franchise in Star Trek II, compared Kirk’s service to the Coast Guard in an audio commentary for the 2004 DVD of Star Trek VI: The Undiscovered Country.
Starfleet may be more than an army and a navy, but to claim it is less beggars belief.
Yet it’s not just Picard or Starfleet that is in denial about itself; the Federation gives the organization way more power than a democratic government would any military.
And Starfleet has often proved itself unworthy of the trust the Federation places in it.
Essentially, Starfleet officers are often seen exercising powers that in the real world would be controlled by civilian governments. Of course, much of this is simply due to the necessities of television - the characters with whom we're familiar have to be the driving force of most of the plots even if it doesn't make diagetic sense. Still, food for thought.