I agree that there are other organisations that conduct themselves in a military type fashion like the coastguard and probably the 23rd Chapter of the StarTrek fanclub, Las Vegas division, the police, even the TrekBBS gives its members honorary ranks.
However the difference between 'pretend' military organisations and real ones is that real ones have great big guns to back them up.
And if that was the ONLY difference we wouldn't be having this discussion. But once again, in the example of the JMSDF we are reminded that having weapons does not make one a military anymore than not
having weapons makes one a civilian.
There's military and military though. I don't think Spock or Troi or Janeway or Crusher for example would join an organisation whose sole purpose was to battle Klingons or Romulans. I believe Starfleet was like someone has mentioned before, like the time of Captain Cooks voyage. He had scientists and map makers aboard.
While I consider that a very good point, it has to be remembered that the reason military vessels were used in exploration during the age of sail is because the military had all of the best ships and the most competent sailors. Exploration therefore piggybacked on the military because it was more efficient than raising money for their own exploration vessels, and because the tools used for exploration at the time were relatively portable and required no installation.
This has ceased to be the case in modern maritime affairs where meaningful exploration requires specialized equipment and ships custom-built for that purpose; the military does almost no exploring whatsoever anymore because their ships are very poorly suited to it.
Extrapolating that same progression, it's possible that by the 23rd century affairs have swung around to the opposite direction where the military is now piggybacking on the exploration vessels because the explorers have all the best ships and even their most powerful weapons are relatively portable
and easy to install.