I have a question, who said that Starfleet is not a military organization in the series? Picard? I don't think Sisko did, but I remember that Picard mentioned it several time in TNG, or if not he mentioned it in an old Star Trek Game called Final Unity. He said to the Alien that the Enterprise was not a warship and it's weapon is means only for self defense. Well, I don't know, but I think Picard is a liar, or else, he won't went around the galaxy with the Enterprise D, a ship full of powerful weapons, the best belong to Starlfeet. Why not going around with an Oberth Class if it means only for scientific and exploration mission?
Or Starlfeet is the sole UFP organization that handle out world matter. Inside, there are scientific and exploration organization like NASA, Diplomatic corp, Military Force, etc.