The problem with the 'starfleet is NOT the military' line is that it so clearly IS in so many ways:
1. The organization is organized along military lines with a naval rank structure
2. The organization fights the Federations wars and also acts as a law enforcement organ
3. There is a top to bottom military-style chain of command, a JAG corps, courts martial, and all manner of military trappings.
4. The members wear uniforms, and the uniforms clearly denote rank
Basically, a rose by any other name, and all that.
All the above aside, I will postulate that starfleet is the Federation's military, but also MUCH MORE. There is the exploration facet to it, the science facets, space medicine, first contact missions, and quite frankly, the training starfleet officers receive for the express purpose of 'thinking outside the box' and dealing with not just the unknown, but the unknowable.
A typical military organization would not have been able to cope with V'ger, or the Borg, or being propelled back in time or beyond the known edges of the universe, or solved the communications conundrum with the Children of Tama. Starfleet can and does do all of those things. So is starfleet 'The Military?' No. Is it organized on military lines and serve a military function when needed? You betcha- ask the Cardassians. Starfleet is starfleet- as unique an organization as we've seen in sci-fi. It exists to serve and protect, to seek out new life and new civilizations, and boldly go where no one has gone before, upholding the founding principles of the UFP along the way. It's really the embodiment of the Federation ideal: that the whole is greater than the sum of its parts.