It was a civil war that the US got involved in, and they supported the side that lost.
Who governs those countries matters, but America cannot spend unlimited blood and treasure ensuring that every country is governed by people we approve of.
The threats were eliminated. Mission accomplished.
Ask Pakistan if the threat of Afghanistan-based terrorism has been eliminated.