While I generally see any attempt to overthrow the government as treasonous, the sentiment is not without historical backing....
...of the people, by the people, for the people.
The United States is an extension of the will of the people. If and when it begins to act against the will of the people is where the 2nd Amendment comes in.
Where folks go wrong is conflating the
securing of the means to violently oppose the government with actively and violently opposing the government.
We the People, through the laws executed by government, get to decide what is and is not acceptable opposition, and at present time we have decided that violent opposition is unacceptable. If a person or small group uses violence as means to achieve some political end, they are not exercising their rights under the US constitution.
But what if the government were to overstep its restrictions so grossly that the people felt they had no choice but to violently oppose it? Would that still be treason?
Congress decides to pass a law that prohibits people from criticizing congress upon threat of incarceration or even death....
The executive decides that it will be more cost effective to assign soldiers an available room in people's homes....
The Supreme Court decides that "general welfare" enables the government to seize your property without compensation....
Armed government agents freely enter and search your home without a warrant....
Defendants are summarily executed without appeal after being brought before and convicted by a trial judge....
These are
extreme examples of government overreach, but they are not unheard of. There have been plenty of governments in that past 100 years that have imposed such things on their people, in fact some of those governments still exist today.
The Second Amendment secures, for the people, the right to maintain the means of opposing such government abuses should they occur (and acts as a deterrent from them occurring in the first place).