The basic situation in Iran is actually pretty simple. They are undergoing a cultural war between the older generation that was involved in the religious revolution that created the current government and the younger generation which has grown up disliking the religious rules.
The older / religious types that control the clergy and upper levels of government sympathize with the Taliban to a certain extent but this is limited by the fact that the Taliban has connections to their hated foe Iraq.
The younger / less religious people have more sympathy with the general population of Afghanistan that has suffered under Taliban rule. However, their ability to act on this is very limited because the older generation hold most of the real power.
The current president of Iran falls into the younger group, striving to pull power away from the clergy and into the civilian government but so far he has had limited success.
As for Iraq, the government is not religious. It is a tribal/military government of people that happen to be Muslim. They are siding with Bin Laden simply because Bin Laden is anti-US. This is one area where the idea of this being a political war wrapped in religious clothing is clearly correct.
Jay