This is just another example of “my enemies enemy is my friend” policy went wrong. The US made this kind of mistake in foreign policies way too often in the last 50 years.
a) Supporting the sha of Persia (a dictator) to threaten the USSR. Result: The Islamic Revolution in Iran, iran was now joining russia against the US.
b) Supporting Saddam Hussein cause he was at war with the Islamic Morons of Iran. Result: Saddam thought he could do what ever he wants to with the support of the US, even against other US allies (Kuwait)
c) Supporting the islamic Mujahideen in Afghanistan against the USSR. One of the most important Persons the US gov supported: OBL, you know how that story turned out on 9/11 ...
The last POTUS who knew how to deal on the international stage was Eisenhower. All the other morons that followed him made the mistake to think military power supersedes morals and values. With military power you might win a war, but without morals and values you will loose peace.