This is what happens when you don't think your foreign military adventures through.
Let's look further back in time:
Mohammad Mosaddegh, Iran's secular and democratically elected leader, was overthrown in a 1953 coup orchestrated by the UK and the U.S., who then propped up a secular but undemocratically elected and autocratic regime whose excesses led to the rise of an unsecular, undemocratically elected autocratic regime in opposition to U.S. interests. America soon threw its support behind an secular, undemocratically elected autocratic regime at war with Iran . . .
. . . who became an adversary and whose demise - in addition to the human and financial costs involved in bringing it about - helped lead to the advent of the Islamic State as described in the first link.