Iran never helped the US attack the Taliban in Afghanistan, and they didn't jut go after ISIS in Syria. They went after anybody Bashar al-Assad hates, and accuses of being with either Al-Qaeda or ISIS. Iran wants the Baathists to stay in power, because they've been protecting the Hezbollah since they were created in the 1980's. It makes it easier for them to start another war on Israel.