Sure, the AT-AT could step over many obstructions, like trees and boulders. Scaling up a 4-legged design to mammoth AT-AT walkers brings few advantages, and numerous disadvantages. However, they are not well suited for front-line action.
Four legs is an advantage to a robot mule that needs to keep up with Marines on a long-range combat patrol through rough terrain. There's a time and a place where this design makes complete sense, such as the four-legged robots that could serve as battlefield mules for foot soldiers to haul gear or wounded troops. I don't want to come off like someone who doesn't support quadruped robots on the battlefield. The name stands for 'All Terrain All Transport,' but even with all these longstanding rules for making a good ride, the designers gave the Empire a bunch of top-heavy four-legged walkers that are vulnerable, slow and easy to spot. Which makes us wonder what the Star Wars weaponeers were thinking when they debuted the AT-AT in The Empire Strikes Back. To do it, a troop transport needs range and speed to achieve the element of surprise during an advance, and armor to protect the troops and gear inside. The whole point of a troop transport is to get fighters and their equipment to the front lines without exhausting them in the process.