U.S military contractors got handsomely rich off both Afghanistan and Iraq and both nations are almost exclusively importing American military equipment. As for civilian items, the average income of an Afghan/Iraqi civilian is not enough to afford American products, but just because not every U.S economic sector benefited does not mean it wasn't worth it for the likes of Raytheon.
As for Iran being very close to Iraq now, that certainly wasn't the plan, is just that there are other players in the world making moves and reacting to U.S. ones and sometimes they come out on top, particularly if they happen to understand the local political dynamic better, because they're actually from the area.