Because it doesn't make sense within the worlds setting.
And having primitive stone-age creatures that have shown no evidence of being stronger (or even as strong as) the average human beating heavily armed and armored elite soldiers with nothing but a few sticks and stones, because that diminishes the struggle of the rest of the rebellion and also, just isn't very credible.
If the best legion of the imperial army gets beaten by such a primitive tribe of halflings with that much ease, then how could they ever control a semi-advanced world, let alone really advanced worlds where high-tech weaponry and other tehnology is readily available.
I was about to type out a big ol' response, but awayputurwpn beat me to the far more articulated punch. They had intimate knowledge of the terrain, had been maneuvering in and around it all their very lives (as in, a predator will eat them if they F up), they got the drop on the empire, surrounding them. And the Empire was doing fine in the clearing until they got arrogant, broke up into smaller 2 and 3 man units and perused the Ewoks into the jungle, where the indigenous life forms with the home court advantage tore them up.
Plus it wouldn't serve the Happy Ending if the Empire gunned down ewoks like a skeetshoot.