The covert history of Iran’s nuclear program is marked by enormous financial costs, unpredictable risks, and unclear motivations.