Tossing the following in as some food for thought.
(Please don't yell at me

)
1) Tactics and technology are not the only things to have changed within militaries over the last few centuries. For example, there was a time when press gangs and flogging were not just the standard in the Royal Navy, they were seen as right and proper. When flogging was finally completely done away with, there were a few dire predictions about how all discipline in the RN would break down and only disaster could result.
There was also a more recent time when the only non-Caucasians found in a USN or RN or RAN vessel's wardroom were stewards and very few people (if any) questioned this. This too changed.
Guess what I am trying to say is that we are evaluating a futuristic (and, face it, imaginary) organization by standards that may not necessarily be as close as we choose to think. Reminds me, somewhat, of an old tale about a very elderly Admiral inspecting a RN steam-powered warship - he gets very very put out upon discovering that none of the officers or crew have cutlasses. How are they supposed to repel boarders if they are unarmed?
So saying "that" shouldn't be how Star Fleet does certain things because "that" isn't how WE (apparently) do (allegedly) similar things is not necessarily a clinching argument. IMO.
2) Lee Correy wrote a fairly good Trek novel called 'The Abode Of Life'. One particular quote worthy of attention:
"You musr remember," the military historian had told him, "that all military, paramilitary or police organizations do not necessarily have to be instruments for the application of physical force to coerce desired action. They can be much like the classical model upon which much of Star Fleet is based: the old United States Coast Guard...".
Service that uses naval-stle ranks, but with noticeably less formality overall.
Check.
Fights when required.
Check.
Routinely handles border protection, exploration, survey, rescue, disaster relief, safety inspections, scientific study, expedition support and even police work.
Check.
Just sayin'.