And yet Iraq now has a republican form of government, and Afghanistan did until the Taliban drove us out.
If you want to make the point that the US acted out of its own interests, sure, but that doesn't mean that we didn't want to provide them something in return - we did. Our failure was in underestimating how complex that would be, and in doing so, we went into a situation not understanding the history, the culture, the political complexities, the logistical difficulties we'd face. We got really cocky (imagine that, coming from America, right?) and as a result, we failed the Iraqis, the Afghans, and a lot of other people. We also seriously destabilized the region in the years afterward - I get all that.
But even in 'good wars' countries always have interests and tend to serve those. That was the case in WWI, WWII, and the Cold War. Interests aren't always wrong, either. We didn't want to live in a world where democratic-minded people had their lifestyle impeded and their politics dictated to by non-democratic countries, and whether you realize it or not, you and the rest of us sitting in the privacy and comforts of our own homes and using this modern technology are likely the beneficiaries of that struggle and the associated outcomes.
I won't deny that we exploited a lot of people along the way, just as China exploits people in other countries, just like the Soviet Union did. Capitalism is unfortunately highly predatory and exploitative. I personally would favor a radical reformation of the global economic system, as the model we have now (mindless, endless growth) is an unsustainable dinosaur that's destined to collapse. I'd rather have a fairer, more balanced relationship with poorer countries and would be willing to sacrifice convenience and some standard of living to get there.
Still, all of that being said, I'm still glad Allied soldiers liberated France and the Jews. I'm glad we defeated the Japanese Empire and drove them out of China and most of Asia. I thought the invasion of Iraq was a mistake even before it happened for the same reasons most of George H.W. Bush's own staff reasoned (and which is why they never attempted to take on Baghdad, even though they were in position to), but there were good intentions and not all the outcomes were bad - many were of course, but not all.