But character quotes come from a character point-of-view and can be wrong. Do we give more weight to those quotes than all the battles and other decidedly military missions we see Starfleet engage in on a rather regular basis?
Do they have other responsibilities outside of strict defense of the Federation? Yes. But so has pretty much every military in human history. Is the military no longer the military when they deliver humanitarian aid? Is the U.S. Army Corps of Engineers not the military?
I don't see where you're contradicting me, to be honest. I am saying that Starfleet is the military. I'm just saying that they're also other things, too.