I don’t think it’s that simple. It’s possible to become a traitor to one’s government specifically because one loves one’s country; though it’s an awfully tricky line to draw.
(I’m reminded of a line I remembered as being from Jefferson Airplane, but when I looked it turns out to be from Phil Ochs: “Just before the end even treason might be worth a try / This country is too young to die”.)
The classic line about treason and patriotism is, What’s the difference between a traitor and a founding father? Who wins the war.
Now some people do become traitors for personal gain; that’s a different issue. And of course some people fought for the Confederacy for personal gain, or at any rate to avoid personal loss: they didn’t want to lose what they thought of as their property rights in other people.
And I agree that there’s a contradiction in people claiming, today, simultaneously to be patriots of the United States of America and to be thinking of Confederate generals as deserving of honor. If they’d had their way, there wouldn’t be any United States of America; or, at least, the states of the Confederacy wouldn’t have been part of it. They were traitors to the country we did wind up with, even though, had they won the war, they’d have been founding fathers (I doubt they’d have recognized founding mothers) of a different country entirely.