There seems to be some confusion between being military and being a total war machine. I spent 23 years in the military and 90 percent of that time was spent in occupational endeavors that did not involve any type of combat or combat support. Among other things, I assisted with Hurricane Katrina relief in New Orleans, Typhoon Relief in Bangladesh, famine relief in Africa, Volcano Eruption-related evacuation (Mt. Pinatubo) and drug interdiction assistance in South America. I can honestly say that I'm much more 'proud' of those times when I helped people than the times I had a weapon in my hand. Using diplomacy and civil/peaceful tactics doesn't make you a civilian any more than having guns makes you military.
One thing that is fairly consistent in Star Trek is the premise of avoiding hostile contact, but Federation starships aren't naively designed without an array of weapons for times when diplomacy doesn't work. The measure of a great society is its intelligent use of forethought and diplomacy far in advance of an actual conflict, but when faced with conflict, you have the means to face it. As President Roosevelt said: "Speak softly, but carry a big stick." I hope that human societies progress to that point but we're not there yet. I'd like to think that the Federation is the military of tomorrow: One known far more for peace than war.
I agree that the military performs more role than just combat based, and appreciate your examples.
I think the difficulty in defining Starfleet's role comes partially from inconsistency from various writers over the years and individual attitudes towards the military. There are so many different attitudes, both positive and negative, that depending on those, people tend to push away or embrace Starfleet as a military.
As originally conceived, I would say military, absolutely. I often wish Franz Joseph's Technical Manual could be included in GR's concept because it really breaks down the TOS era Starfleet in a very military style.
Even if it isn't a military exactly as militaries are now, why not call Starfleet a military organization?