All Starfleet had to do was push for a new arm of the Federation government to act as a military.For a short time (say a few years around the 2350s through the early 2360s), it’s reasonable to think from Picard’s dialogue that Starfleet was trying not to be a military anymore, the Cardassian conflict aside—heck, maybe because of it. But the universe just didn’t let that work out.
Bam, Starfleet is no longer it.
But, Starfleet is on the front lines with multiple wars, with the Klingons, Tzenkethi, Cardassians,Talarian, among others. Just be like, "Hey, Federation Council, we are doing a lot of fighting. Can we get a dedicated fighting force?"