|You know it makes sense|
In the original series, Star Fleet is more or less the space navy of the Federation. We follow the adventures of the Enterprise, which is on a voyage of exploration (perhaps inspired by voyages like those of Captain Cook, though these days that might be more controversial) and we don't see much else of the Federation.
However, we do see enough to be conscious of the civilian side. Federation civilian officials turn up from time to time, and they sometimes have authority over Starfleet. In "The Trouble With Tribbles" (TOS) the Enterprise is called to a space station by a priority one call. Kirk expects to find a Klingon attack, and when he doesn't find one he demands answers. The head of the space station, who incidentally has the title "Manager", not Commander, says that the order came from Nilz Baris, the Federation Undersecretary in Charge of Agricultural Affairs in the region. This, Spock points out, gives him the authority, even if Kirk doesn't like what he is doing. In "A Taste of Armageddon" (TOS) Ambassador Fox has power to give orders to Kirk, though this seems to be just for that mission. It is true that they are annoying people who make foolish decisions, but then so are most of the Admirals and so on that Star Trek captains have to deal with. Scotty expresses annoyance with diplomats, but he would, wouldn't he.
It was said that whereas other countries had an army, in Prussia the army had a country. By the time of TNG, Starfleet shows curious signs of moving in that direction. Starfleet is no longer just a space navy or exploratory organization, but seems to be the Federation's primary organ. The premier academic body the Daystrom Institute is part of Starfleet, and a professor from it who comes to the Enterprise is a Starfleet officer in uniform ("The Measure of a Man" TNG). When Captain Picard realizes that Professor Rasmussen, the time-traveller who claims to be a historian from the future ("A Matter of Time" TNG), is actually an impostor from the past, and Rasmussen is stranded in the 24th century, he tells him that "historians at Starfleet" will be interested to meet him. Historians at Starfleet? Why in Starfleet? (However it's true that in "All Good Things" (TNG) we see a future in which Data has become a professor at the University of Cambridge, which still seems to be separate from Starfleet.)
Star Trek TNG was supposed to have a Starfleet that would be less military in nature—there were even families on board—but in fact it showed a greater emphasis on rank, and more reference to the formulae of the real-life American armed forces, than TOS.
In "Peak Performance" (TNG), incidentally a very good episode, Picard is unhappy about having to carry out a military exercise, and tells the strategic expert that Starfleet is not a military organization—its main purpose is exploration. However, once they are underway they all participate with gusto, and Data is able to analyse a whole lot of data from Riker's career (Riker is commanding the other side in the exercise).
The status of science seems to take a bit of a dent, too. In TOS, Spock is Science Officer. It's rather striking that even in the Mirror Universe, Spock refers to his "scientific duties" and Marlena the captain's woman works in the "chem lab". But in TNG, scientists, though important to the mission, don't seem to figure as very active characters so much. In "Tapestry" (TNG) Picard finds himself in an alternative reality where he is a Lieutenant in Astrophysics. This doesn't satisfy him and he tells Riker that he wants to "move beyond Astrophysics to Engineering or Security" and perhaps thus to Command. Riker is very dubious. This indicates where science stands in the hierarchy, at least as Picard sees it.
The status given to Security is interesting. In the original series the Security men are seldom seen as characters. The chief of Security is apparently an Ensign ("Obsession" TOS). In "Turnabout Intruder" (TOS), the last episode of TOS, Kirk changes bodies with an envious woman, who ends up by ordering the execution of senior officers for mutiny. Chekhov and Sulu are outraged, and realize this cannot be the real Kirk, but it appears that Security is continuing to back the fake captain despite his illegal orders. (Don't worry, Kirk regains control.) In another episode, at one point McCoy refers disrespectfully to an unwelcome Security man (in his presence) as a "muscle man" ("The Alternative Factor" TOS).
But in TNG, Security is a high-status section, whose head is a prominent character.
This is speculation, but it's worth noting that at the time of TOS a large proportion of the people involved with Star Trek had served in the Second World War, and in that period military police tended to be unpopular with ordinary soldiers.