Afghanistan was a 20 year long war. It was more costly in terms of troops, material etc.
Why would ending the war mean handing the world to the Iranian regime? That seems exaggerated. The iranians will charge a small toll for oil passing Hormuz, why would the US care? They have oil.