Starfleet is military by it being an armed force of the Federation but clearly their charter is far more diverse than most of today's modern military organizations and perhaps only a small portion of their overall funding goes directly into weaponry, space defenses, combat training, etc.
But that would only be possible if technology has rendered war such a trivial affair that just about anyone could successfully fight an entire war without really being trained to do so. That's obviously true in SPACE combat, which seems to be more of an engineering task than a strategic one. But that is OBVIOUSLY false in ground combat: the Klingons, the Romulans and the Jem'hadar are effectively Ugly Bags of Mostly Badass and not the kinds of people you'd expect to fight off with a platoon of lightly-armed geologists who took a self-defense course in their spare time.
There's a tendency in these discussions to assume "Starfleet isn't a military" is an indictment of military forces being too violent or too aggressive. That, to me, seems breathtakingly immature: military priorities and military readiness are fundamentally incompatible with the ideals of a civilized society, not because militaries are uncivilized, but because WAR is an uncivilized activity that is ill-suited for amateurs, generalists and especially idealists. That a Starfleet officer could even say with a straight face "Starfleet is not a military organization" and even have his first officer back him up isn't the reflection of a single person's inexplicable idealism; Starfleet is the kind of organization where a man like Picard could become the Captain of their most powerful starship
That tells us quite a bit about how Starfleet in general views itself. It also tells us that we have never really seen the Federation's military: if Starfleet was their only defense against the Romulans or the Klingons, they would have been conquered centuries ago.