I know that species, like the Organians, have evolved to the point where they can defend themselves without the use of militaries. But, have we seen a truly advanced civilization in Star Trek that didn't need a military?
The First Federation.
Just off the top of my head.
Besides I've been replaying the Mass Effect trilogy and the main character tends to do stuff that Starfleet mostly spends their time doing in Star Trek and its repeated several times that he is a member of the military. So it's not like running around exploring the universe means you can't be a military.
Nobody claimed it does. The Alliance Navy from Mass Effect is partially an expeditionary force that spends ALMOST as much time exploring as it does performing military maneuvers (but even then, not nearly as much as Starfleet).
On the other hand, the Normandy SR-2 -- which is larger, more powerful and significantly better armed than the SR-1 -- is a civilian ship manufactured by Cerberus and carries a somewhat more advanced sensor suite on top of it. Commander Shepard can run the SR-2 under military discipline despite the fact that Cerberus is by no means an actual military; it's a nonprofit at best, a terrorist organization at worst.
But since you invited the comparison, what do you say we run with it? Have you noticed, yet, all of the less than subtle nuances in the Mass Effect universe -- the discipline and protocol of the crew, the emphasis in combat readiness, the absolute clarity in the ship's mission to protect Earth and her colonies at all costs, and most of all, the polished utilitarianism of the Normandy itself -- all of which are so very UNLIKE Starfleet as depicted in any Trek production so far?
If Starfleet were a formal military organization there would be no difference; Starfleet would be exactly like the Alliance Navy in almost every way, with exploration as part and parcel of their combat/patrol duties. That the differences exist AT ALL should tell us something.