And Starfleet serves multiple functions, including military ones. It really can be both.
It CAN, but it isn't. It's a paramilitary organization that serves multiple functions, including (as the title implies) traditional military ones.
They presumably have submersible craft, which are likely capable of going deeper than today's submarines.
Or, for that matter, the Federation's starships.
Legally, yes.
The more I think about, the more I think that "Starfleet is a military" and "Starfleet isn't a military" are in a sense both correct.
Legally, there is little difference between a military and legitimate paramilitary organisation (HRT for instance) as both are "lawful combatants". The former has a little more independence in terms of internal disclipine, punishment and one of two other areas (which Starfleet appears to have for the most part). But both are essentially fighting forces from a legal standpoint, so legally the differences between the two is largely one of semantics.
However, "Starfleet is not a military, it's purpose is exploration" isn't actually as irrelevant or incorrect as I thought. For instance, the USCG is legally, by statute, a military, however unlike the Army, Navy, Marine Corps and Air Force it's purpose is not primarily military but law enforcement (this is even mostly true of individual Coasties seconded to the USN) and rescue (they are the lead agency for sea rescue for US waters). So a similar dictomony could exist for Starfleet and Picard - being anti-war - chooses to focus on what Starfleet does rather what it can do if required by external factors.
I've always assumed it was more specific than that: that the Federation DOES have organizations whose statutory purpose is combat and defense, but Federation law prohibits them from operating in interstellar space and they are only allowed to operate in the territorial space of the worlds they belong to. The Bajoran Militia would be one example: if and when Bajor joined the Federation, the militia's operations would be limited to functioning only within their own solar system and they would have to transfer most if not all of their space assets to Starfleet or some other authorized agency.
The reason for this would be pretty straightforward: the Federation was founded by various species that, in the beginning, didn't really trust it each other and barely even LIKED each other but banded together out of necessity after seeing the benefits of mutual cooperation. One of the sticking points of the new alliance would have been how disputes were arbitrated and who got to authorize the use of force and how. The smaller and more paranoid members -- the Andorians, for example -- had real reason to fear one of their rivals using the Federation as a vehicle to impose regional hegemony so they wouldn't agree to any solution that would give any one world the ability to dominate others militarily under the Federation's banner.
And then they thought, "Hey, why not give the pinkskins that job? They've got no economic interests outside their own system and their fleet isn't even a real military!" This provided enough of a compromise to cement the Federation into what it is today, for four reasons:
1) The overtly peaceful nature of Starfleet makes it less likely for them to be the aggressors if a first contact situation turns hostile, which means they're also less likely to drag the entire Federation into a war nobody wants
2) Being focussed on exploration means that the fleet's peacetime operations will pay very real dividends in scientific research, particularly when it comes to energy exploration and natural resources. The information gathered by Starfleet can then be used to benefit ALL Federation members. Military organizations belonging to any one world would be more likely to hold some of that information as a state secret and use those resources to give themselves a slight advantage over the others.
3) Without a permanent military mission (not to mention their adherence to the Prime Directive) Starfleet must get
direct authorization from the Federation Council to participate in hostilities. So if the Andorians or the Bolians decided to declare war on Krios Prime for some reason, Starfleet isn't allowed to get involved until and unless the Federation Council specifically orders them to; ON THE OTHER HAND, they'd still be able to hang around in the region, provide humanitarian assistance, and probably get right in the line of fire between opposing fleets and DARE them to try firing at each other because "First one of you assholes hits me gets a photon torpedo where the sun don't shine!" They are, in other words, perched on the legal edge of "military" with just enough power to keep the peace but not quite enough to break it.
4) Even if, by some fluke, Earth decided to try and impose a "Pax Terra" over all other members, Starfleet is an unwieldy tool for that kind of takeover and is unlikely to allow itself to be used for that purpose (as Admiral Leyton found out the hard way).