The thing that people forget about the Mexican war is that it could have - and almost did - have a really profound effect on U.S. history, in a really really bad way.
The South almost won the Civil War despite the fact that they were out-manned, out-gunned and out-industrialized, because they had the better generals. And, uh, where did those generals get their training? Mexico. It was just dumb luck that the South ran out of generals before the North ran out of everything else. (I'm simplifying for effect, of course.)
In the Iraq war we are training the insurgents and militants who will later take over all the surrounding countries.
Wars beget wars. Wars train people how to war. Ack.