No, just no. TOS showed Kirk and company as soldiers when it suited the purpose of the story. "Errand of Mercy" and Kirk describes himself as a soldier to Kor, and is ready to fight the Klingons to save the Organians. "Friday's Child" shows a red shirt dying in the first act because he sees a Klingon and immediately draws his phaser. This is off the top of my head. There are plenty of others.
Or TNG, if you like. In "Angel One" the ENT-D is preparing to go to the Neutral Zone as a show of force against a Romulan battlecruiser encroaching upon the Neutral Zone.
Militaries have a many different tools to achieve their goals and missions. The idea that a military just goes around and shoots to achieve its end not only misses the point of a military, but overlooks the humanitarian, research, construction and transportation missions that are part of their duties.
Sorry, your examples are an oversimplification, at best, and indicate a gross misunderstanding of a military organization.
Actually I understand what a military organisation is fine....the SCE is a bit like REME for instance. However we are interpreting things under a broad definition of 'military' in order to go against an on screen definition of Starfleet as explicitly 'not a military'. That's not a value judgement on militaries, and certainly not on modern militaries...however, Trek is very much framed in its relationship to Westerns because of when it was made. Once you allow a similar broad understanding of what 'exploration' is, and frame Trek in its context (sixties television, post war society) then it goes fine with 'Starfleet is not a military' without it being a value judgement. It is what militaries become when that defensive, weaponised force, aspect is so far down the list of priorities because of the nature of Treks utopian world. We jump through hoops...Kirk calls himself a soldier. But a soldier is a very broad term to start off with, and you can certainly argue that Starfleet is still in transition during TOS and even Kirks lifetime. He also says 'we are explorers' the two aren't mutually exclusive....but Starfleet is explicitly stated to not be military. This is not a value judgement, I don't think the military is automatically shooty shooty bad thing! Bad thing! But that reputation is different everywhere in the world depending on experience, to the point that when looking at an international viewpoint...you don't want your heroes to be explicitly military figures. No matter what we as individuals may know about military duties or what moral/value judgement we then come to....on a wider and more simplistic scale, a military is for one thing in the popular imagination, and certainly was when the various Treks were conceptualised. That defensive military aspect is explicit in not defining Starfleet, because it's considered by those people in that future (or those people who made Trek) to not be a large enough part to define them. Did they grow out of military tradition? Sure. So did commercial airlines and even many entertainment groups. Is there anything wrong with being military? No, not from my and many people's perspective. But Starfleet is explicitly stated by on screen reliable narrators to not be one, and the primary creators state as much.
Is this a bad thing? Only if people want to make it into one. The great thing about Trek and Starfleet, is the service people can see an idealised version of themselves, but so can everyone else...particularly scientists, engineers, medics and service people admittedly. But anyone. Including people who maybe don't have a good experience with the military one way or another.