Reagan survived the Iran-Contra scandal because the elements of it that were illegal (aiding anti-communist Nicaraguans) were popular and the things that were unpopular (arming the Iranians) were quite legal.