Cosmoline
It seems to me that a rebellion, in order to be valid, must be done under the auspices of some valid sovereign representing the will of a sovereign state. Anything less is simply a criminal act and can have no protection. Obviously there's going to be an argument about who the valid sovereign is, but there has to be a chain of command and it has to go back to the will of the people.
Let's look at 2 things:
First, ANY rebellion against a sovereign government is - by definition - a violation of the law. It simply cannot be any other way. Our own Revolution was viewed by the Brits as an uprising by a bunch of traitors and their sympathizers, and the penalty for any of the leaders caught by the Brits was hanging.
Second, our own Revolution itself had no authority from any sovereign government. The rebels (whom we call Founding Fathers) got together themselves and voted to start a new country. Yes, they voted in a democratic (small "d") manner at Independence Hall; yes, there was a Continental Congress - but the reality was that this entire enterprise was viewed by England as treason, pure and simple.
My conclusion is that the winner writes the history. Had the Revolution been unsuccessful, George Washington would have been a small footnote to history, and most of history as we know it for the past 200+ years would be vastly different. Had the Whiskey Rebellion of the 1790's been successful, those people would likely be looked upon as heroes - but they're now looked upon quite differently.
So, what does the 2nd Amendment do?
It protects "the right of the people to keep and bear arms."
Why?
Because such is "necessary to the security of a free State."
What does THAT mean?
As I see it, the security of the State (meaning the entire country, not one particular state like New York or Virginia) can be endangered from 3 sources:
1) Invasion by a foreign power - OK, that's easy. Red Dawn time, every patriot grabs a gun and shoots the Redcoats, Russkies, whomever.
2) Rebellion - presumably this would mean some type of military coup, but it could also mean a bunch of states deciding to leave the union (I seem to recall something about that from history class).
3) Tyranny - mass violation of basic rights by the ostensibly legitimate government; imposition of dictatorship like Caesar, Hitler, etc.
Street criminals, while a threat to individual citizens, don't threaten the State, so that's not included in "security of the State" though it is another legitimate reason to have arms (and so the Court finally stated in
Heller).
OK, so how does the State deal with those 3 threats? Well, the Constitution gives the Congress the authority to regulate and discipline the militia. A sensible government would organize it in such a way as to significantly augment the power of the nation's armed forces in the event of invasion or rebellion.
Ah, but what about Door #3, where the State itself becomes the enemy? The enemy of who, or what, you may ask? Who determines this? I would say the enemy of the liberties of the people, as such are enumerated in the Declaration of Independence and our Constitution. But, of course, the State will have judges to rule that its laws are perfectly legal, perfectly necessary to protect the nation and its people. Lincoln was, by the standards of any other time in our history except the Civil War, a dictator. He jailed people for voicing their opinion, or even for reporting facts. Hitler had most of the German judiciary behind him (at least nominally - they, too, were intimidated). So the State would say it is doing things right (i.e. legally) against some group of (by definition) treasonous rebels.
Of course, according to the nature of the thing, the State is not going to want the entire population armed, only those reliably on the side of those running the (now illigitimate, or allegedly illigitimate) government. Everyone else is a criminal, mentally deficient or a traitor, and cannot keep or bear arms (and maybe gets shot after a brief encounter with a military tribunal that the civilian courts rule is perfectly legal).
Again, we're back at the crux of the problem - when is it legitimate for the militia to organize itself to fight the government? The only answer I can give lies in Declaration of Independence. And, again, only the winner of such a hypothetical struggle would determine the legitimacy of the rebels and their claims and methods, just as was the case with our Revolution.
I think it a mistake to say catagorically that without the validation of some state's (in this case "state" as in New York or Virginia) government, any action by the militia (meaning the body of the people) is wrong...just as it is a mistake to say that such is catagorically right. Some hypothetical scenarios would be very clear cut, but life is rarely like that - you rarely (thank Heaven) get an Evil Emporer that everyone KNOWS is the criminal.