The correct answer is 'we shouldn't've pulled out back in 2010', but of course the past can't be undone and in the present situation we're basically doing the right thing.
Indeed, Iran should be on our side. Really wish they were. They need to lose the religious oligarchy at the top.
If USA are able to cooperate with Saudi Arabia, they are also able to cooperate with an Iranian theocracy.
The problem is that discord with the US is an integral part of the Iranian regime's ideology, which isn't the case in Saudi Arabia (even though, as dead0man said, Saudi Arabia is certainly the more conservative and repressive of the two). Iran nearly went to war with the Taliban in 1998, and has long been an opponent of extremist Sunnis/the Taliban/Saddam Hussein; we could've been allies for the past decade and a half, but it didn't turn out that way. It may yet, depending on who replaces Khamenei.