The oath they take is to defend The Constitution of the United States. Big difference. Lee, et al, were most definitely not traitors.
That doesn’t make a lot of sense.
I’ve personally given slack to REL on the the issue of treachery against the US because I recognize that he was caught in a dilemma - honor his oath to defend the United States Constitution even though it meant that he could be opposing his immediate friends and family (while paradoxically defending people who were openly hostile to him) or throw in with the locals - and walk away from his oath.
Admittedly hard choices, he chose to reject the Constitution.
And what do you think the Constitution represents? A mere set of words on a piece of paper?
Lee WAS a traitor. He took up arms against his own country and it’s duly elected government.