You should read the Second Amendment again. It doesn’t say that the militia has any rights. It identifies the people as doing so. It does not create or grant anything, but acknowledges something that the people already possessed.
Prisoners have many of their rights curtailed by virtue of their actions. Ordinary citizens, on the other hand, do not.
I recommend the essay, “Don’t let Colonel Blimp ruin the Home Guard.” Orwell suggests no such desire to allow the government to restrict the rights of the people.