Starfleet, IMHO, is clearly a military. They are the primary defense agency of the United Federation of Planets. They are the ones who fight a war if the Federation is involved in one. I just don't see how there can be any question about that.
However, I think Franz Joseph's interpretation of their primary function being that of defense and security is a bit overstated. Certainly, Starfleet would always be tasked with defense and security functions. But under normal, peacetime circumstances -- which have existed most of the time we've seen the Federation depicted -- their first objective is one of exploration.
So I would say that, yes, Starfleet is a well-trained, well-armed military, but they are also a well-trained scientific service and if they have to abandon their scientific endeavors to perform military functions, it's considered a failure on the part of the Federation.