With the Mujahideen (Taliban and al-Qaeda), it was obvious: attack the Soviets.

But why ISIS? When they overthrew Saddam, why would they fund a group that would attack their own puppet government?