So, stepping aside from the discussion of whether Starfleet is a military organization and getting back to the OP. . . how did the Federation handle ground combat in the Dominion War? I get the impression that during the TNG era, shipboard security was sufficient to deal with most situations both on the vessel and in supporting small colonies that lacked a full infrastructure. Colonies and member worlds would presumably have their own police/defense forces, I believe there are a few instances in TNG although it might not be entirely clear if some of those worlds were actually Federation members. I still think it's a fair assumption, though.
So before the Dominion War, we really don't have a need for a ground force devoted solely to combat. We saw ground combat in DS9 during the war, though, and we know from the behavior of the Jem'Hadar that ground combat was a very real possibility that Starfleet should have foreseen. Obviously, all of the instances we saw involved a shipboard crew actually fighting or supplementing another force because we follow a specific set of characters. It took an emergency situation, like the Siege of AR-558, to put those characters in the fight, and was definitely not ideal. Do we have evidence, though, for dedicated ground troops? Was there a need for them? When I rewatched DS9 recently, I focused a lot on how the war was actually waged, and it struck me that, aside from the heavy fleet combat, the war appeared to be rather restrained in territory loss. DS9 was captured and retaken, Starfleet took Chin'toka (leading directly into the Siege), Betazed was taken, and there was a raid on Earth. There may be other worlds that were actually contested for occupation (not just attacking orbital facilities), but I don't recall any others mentioned by name. So maybe it could be possible, although I think unlikely, that Starfleet was able to handle what conflicts there were for territory without radically restructuring the way it handled ground combat. I think, though, that we have to take into account the war that didn't
happen as well. More worlds could have been lost, and an invasion of Cardassia Prime (and maybe other Cardassian worlds) could have been necessary. Kind of like the aborted plans to invade Japan itself in WWII, the war's rapid end didn't mean that they could avoid preparation for what would have been a long and bloody conflict.
The question, then, is did Starfleet create, re-create, or rapidly expand a pre-existing military ground force for the war? Was it necessary, or were existing security personnel, either actively serving on ships or reassigned into task forces, adequate? Where did these personnel come from? Are they all as highly trained as most Starfleet members, or are they focused purely on combat? While Starfleet may not like the idea of purely military personnel, there's also something to be said for not sending off your most intelligent and highly educated people to die in the thousands if you can help it. Which kind of brings up another question that touches on the fleet itself - was Starfleet rapidly expanded for the war, or just concentrated into massive fleets instead of being spread across a huge Federation? If it was expanded, and maybe even if it wasn't, Starfleet may have to deal with the repercussions of an entire young generation of officers who see themselves as soldiers first, rather than explorers.