Why did Reagan favor trading arms to Iran for the release of American hostages in Lebanon?

Why did Reagan favor trading arms to Iran for the release of American hostages in Lebanon?