At some point in time the Federation would be reasonable in creating a military because they are at near constant war. It's ridiculous to rely on NOAA all the time if there is constant combat.
At most we have seen small scale skirmishes that are usually one on one and contained to certain sectors.
On occasion, an invidiual may try to bring down the Federation, but they tend to be stopped by a crew of a single starship.
Full scale wars on the other hand don't seem to be that common.
The conflict with the Cardassians (before the Dominion War) was effectively a border skirmish that wasn't really talked about a lot (it didn't seem to have escalated enough to be considered a 'war').
There was an Earth Romulan war in the 22nd century.
There was war with the Klingons in the 23rd century (which started with the battle of the binary stars).
There was also the Dominion War in the 24th century.
Some mentioned the UFP were at war with the Borg, but the amount of encounters with the Collective were years apart and usually involved a single Borg vessel (which needed a fleet to stop)... at least until the events of ST: Pic S2 (but prior to this, the first encounter was in the J system, second one in BoBw, third encounter in TNG: I Borg, fourth, in TNG: Descent, fifth encounter in FC movie (and a few other appearances on VOY - but that ship was closer to the Collective on a galactic scale), and after the events of 'Endgame', there was seemignly 1 encounter (sure the crew of the Protostar encountered the cube which was implied that it was the Artifact from ST:Pic S1), but otherwise... not really a war in a classical sense.
The UFP seemd to have had a major 'war' once every 100 years. But from what we saw on ST: Disco, there hadn't been much in terms of classical war until the 26th century (Sphere Builders - and they were dealt with in an alternate 26th century), and then eventually the Temporal Wars (which took up a good chunk of the 30th century)
The Temporal Wars muddy things a bit since those were waged throughout history (or across thousands of years - incursions into different time frames), but for the most part, local timeframes remained fairly unaffected because of Temporal Operatives and crews of various timeships from the 31st century ended up involved, and as we saw, most changes anyone tried to enact were negated (as if they never happened to begin with)... there was a small exception to this with the Xindi attack on Earth, and the destruction of Paragan colony... but it appears, those events needed to take place.