[deleted]
The crime of treason in the United States is limited by Article III, Section 3, of the United States Constitution: Treason against the United States, shall consist only in levying war against them, or in adhering to their enemies, giving them aid and comfort. The same clause also places procedure limits on procuring a conviction: No person shall be convicted of treason unless on the testimony of two witnesses to the same overt act, or on confession in open court.
The crime of treason was felt to have been abused as a political tool in the United Kingdom, which is why this clause was included in the US Constitution. Congress has since passed laws against sedition and espionage, for example, that are not as restricted by the text of the constitution. The Rosenbergs were not convicted of treason, for example. They were convicted of espionage.
Now, let's imagine the political climate would actually have resulted in Reagan being charged with treason. What would his defense have been?
Well, he certainly didn't levy war against the United States. What about adhering to their enemies? The Constitution does not define "enemy", nor does any statute. There isn't much case law on the matter, but in United States v. McWilliams, 54 F. Supp. 791, 793 (Dist. Ct. D. C. 1944) there is a case of conspiracy to commit treason through actions done on behalf of Germany between 1933 and 1940. The court noted that war had not been declared on Germany during that time, so it was not an "enemy".
The definition of "enemy" would have been key to the case. I would say it remains an open question that has not been seriously tested in the federal courts in the US.
/u/babak1980 is spot on with his explanation, just to provide a little more elaboration: as I understand it, when the Iran-Contra discussions were happening, Reagan would be in the room and listening, but the discussions would not be addressed to him. His governing policy frequently had him telling his staff to "work it out" among themselves rather than disputing or getting involved.
So, in that sense, it's the argument of "Do the means to the end matter or just the end itself?" His staff thought the end itself was all that mattered: Reagan hated the Sandinistas and wanted them gone, and the money that was funneled through was done in such a way to provide him with plausible deniability. There was also, as detailed in Brands' Reagan, a lot of foot-dragging within the succeeding Bush administration to provide the documents for evidence to the legislative branch, which really put a kink in the investigation, if memory serves.
In addition to that, as also started by /u/babak1980 (not to beat the hell out of your username), there was simply not the political will. I would expand on that by making an arguably tenuous claim: almost as soon as Reagan leaves office, there is a move to have him canonized and raised up as a great bastion of Republican values, as seen in the actions of politicians like Grover Norquist and Newt Gingrich.
There hadn't been a 'great' Republican president arguably since either Eisenhower or Lincoln, unlike the Democrats, who are able to point to the likes of JFK, FDR, Truman, and even Woodrow Wilson, a string of some of the greatest presidents of the 20th century and some of the most well remembered in the public eye (I'm looking at you, JFK).
There was a need for a figure to rally behind, and Nixon was fallen from grace due to Watergate, Ford is remembered mostly as a bumbler, the 1920s presidents (Harding/Coolidge/Hoover) helped drive the country into the Great Depression, and even Eisenhower is remembered as a bit of an elusive figure and certainly isn't "Mr. Republican": up until the convention, there was considerable debate whether he was a Republican or a Democrat, and Truman even offered multiple times to help him get the nomination (per David McCullough's Truman). Great man and indubitably an American hero, but a tough guy to turn into the standard bearer of your party.
Sources:
H.W. Brands, Reagan
William Kleinknecht, The Man Who Sold the World
Will Bunch, Tear Down This Myth
Jon Meacham, Destiny and Power (HW Bush biography)