It says treason against the United States of America - not the ‘Union’.
He never was a citizen of the Union, and so could not have been a traitor against her.
The United States of America was a union of 34 states in 1861.
R.E. Lee fought against this great union.