The problem with ground forces and ground combat in Trek(aside from the fact that we have never really seen it onscreen) is that Trek technology radical changes everything we know about how it would be fought, and what would be the objectives. And the writers have never really thought it out very well.
What are you defending on a planet? Population centers? Industrial Replicators? Both are easily portable with access to tractor beams and transporters. If you are remaining in place, how can you defend yourself against warpdrive missiles, meteor bombardment. Massed torpedo or phaser bombardment. Hyper velocity projectiles of all shapes and sizes, traveling at a good fraction of lightspeed or even at warp. How can you defend against your local star exploding(which we know various folks in Trek can pull off) or WMDs being beamed to critical locations?
Obviously you have to have massively strong planetary shields and massively long range tranporter scramblers. Neither has ever been seen in Trek, but lets assume they exist. It is logical.
So our theoretical ground troops are either infiltrating in to destroy these defensive systems, or defending said systems. But wait, how do you get a soldier or group of soldiers past shields or scramblers? Well, there are any number of technobabble solutions, but they all have one huge problem. If you can get a man past a planetary shield, you can get a WMD past that same shield, so what is the point of having ground troops?
Okay fine, so ground troops would be pointless in full scale planetary combat. But whatabout all the smaller-scale conflicts and battles, where utter destruction of the enemy is not the objective? Sure, you can have your Marines bouncing around doing this or that. But again Trek technology makes it all seemingly pointless. First you have incredibly powerful and accurate sensors(As a Cavalry Scout in the US Army, let me say that this alone negates a huge amount of what we grunts are used for today.). You also have incredibly powerful shields and weapons, advanced robotics, magical matter transporters, self replicating warheads, cloaking fields, artifical gravity, advanced AIs, mobile tactile holograms, and a whole slew of other systems
Today we say that you have to have boots on the ground to win a war. And it is true...today. I spent 15 months in Iraq, and yeah we grunts are definitely crucial. But given Trek technology, that just isn't true in-universe. Imagine a hostile Klingon planet, huge population, armed to the teeth. Well, we're going to beam down a handful of self-replicating combat drones, they hover, they're shielded, they have more firepower than a company of present day battletanks. They'll do the dirtywork for us. Then after the major population centers are subdued we'll send down an army of mobile holograms equiped with powerful weapons, and a direct link to whatever orbiting ships we have available. We've seen the pinpoint accuracy of Trek weapons, slaving the entire firepower of a Sovereign or Defiant-class starship to the command of a hologram or a single soldier on the ground would be no problem at all.
When you can put the firepower of a fleet of starships at the literal fingertips of a single drone or man what is the point of armies or units of any size?