Indeed he did, but he could not be a traitor to it, since he never was a resident of any union state.
You want a traitor, go with Paul Revere.
Of course Lee was a resident of a Union state ~ it was called Virginia. During the war a rump government was established in Northern Virginia, where the Lee residence is located (SEE: Arlington National Cemetery). The federal government didn’t ask their permission to buy Lee’s property at an open public auction ~ and it got standing in the Lee family suit to recover Arlington on that basis.