I have no doubt several worlds have independent military worlds. I'm also willing to believe several worlds have disbanded anything resembling a military since they are deep within the Federation and therefore don't need a military (so border worlds and worlds with strong military traditions probably still have planetary militaries).
I still don't believe that Starfleet (or the Federation) has a dedicated Army/ Naval Infantry/ Marine Corps / whatever you want to call it. We can debate this by todays standards, but thats us trying to put our beliefs on a fictional universe thats supposed to be better then us.
And if grade schoolers are learning calculus, then I think Red Shirt (Gold Shirt?) Number 52 also knows how to flank the enemy when needed and throw a photon grenade.