Iran is a Shiite majority country, Iraq is a Shiite majority country. Once we toppled the Sunni minority that was keeping a boot on the Shiite neck then moving closer to Iran was inevitable. Even if Obama and Bush had handled the war and occupation competently this situation would have happened anyway.
The only “right way” was to use Afghanistan and Iraq as pincers for the purpose of eliminating the Iranian threat, thus weakening even the Arab terror threat greatly in the process. But Bush went along with the Democratic Party’s plans instead.