In law, treason is the crime of disloyalty to one's nation or state. A person who betrays the nation of their citizenship and/or reneges on an oath of loyalty and in some way willfully cooperates with an enemy, is considered to be a traitor.
Treason doth never prosper: what's the reason? Why, if it prosper, none dare call it treason.
Sir John Harington, Epigrams, Book iv, Epistle 5. Compare: "Prosperum ac felix scelus/ Virtus vocatur" ("Successful and fortunate crime/ is called virtue"), Seneca, Herc. Furens, ii. 250.
The last temptation is the greatest treason: to do the right deed for the wrong reason.