Got away with? That's an interesting perspective. We take 3,000 casualties, they lose a country, soon to be two countries, get their financial umbilical cords cut, face a global manhunt, and have no real prospect of getting back on their feet. At prices like these, no one can afford terrorism in the long run. Do the math.
Sure, we could have nuked Afghanistan. That would have created far more problems than it solved, and wasnt' necessary in the first place. An eye for an eye and a nuke for a nuke, sure, but nuking everyone who pulls off a suicide hijacking or bus bombing is foolish overkill.