A lot of definitions and ideas change in the 24th century. So I can grant that in the Trek universe, society's needs and ideas have shifted so drastically that the very concept of what a military is and what its role is has changed from being primarily defense to primarily exploration. Because that is what they're doing almost all the time -- exploring, not fighting. Today, when the military isn't fighting, they're drilling and preparing and building defense and security capabilities to prevent wars. That isn't really what Starfleet is doing in their down time. That changes once they encounter the Borg, and they're definitely a military during the Dominion War. But in general, they're explorers first and soldiers like fourth or fifth. Can they prioritize exploration and diplomacy and science and still be a military organization? ....Sure. Sure they can. But we have to mean the same thing when we say "military" and I think that's the divide here.