Lee was never charged with treason.
Doesn’t make him any less a traitor to the constitution he swore an oath to.
Lee was indicted (charged) at the behest of Andrew Johnson but never tried. Following President Lincoln's instructions and his own desire to "Let us have Peace," General Grant granted Lee and those who surrendered Appomattox paroles which prevented the more vindictive of the Northern leadership from trying Lee or any of his officers and men for treason. I think that Salmon P. Chase who was the Chief Justice of the United States at the time concurred with Johnson that jefferson, lee, and others should be tried, but they both recognized obstacles both legal and political lay in the way.
Johnson granted pardons on July 4, 1868 and a broader one on December 25, 1868. It is considered that one or the other (or both) served to pardon lee for his crimes.
I also found this while double-checking dates. It is a copy of lee's amnesty oath.