That is not true. The USSR armed Iraq. The USA armed Iran up until 1979. After that, the USSR armed both. The USA gave some intelligence to Iraq during the Iran/Iraq war.
Mullashs aside, we would have been far better off backing Iran, which while a fanatical muslim controlled government, intel would consider the persians in Iran a geopolitical counterweight to the Arabs, which would mean far less turmoil in Israel too.. Aside from the fanatical mullahs and their nuclear ambitions, the Iranian's beef with us is more geopolitical than Ideological, hence why they currently back Hezbollah in Lebanon, Syria, are trying to get the bomb, etc.