To allow citizens to not have to depend on government law enforcers to protect their lives, liberty, and property?
Yes. Right from the outset, the government realized that it needed to make a law that allowed citizens to ignore the laws. Had they not passed such a law, disregarding the laws would be illegal.
No. It’s to enable citizens to defend their country from foreign attack, and, some believe, from tyrannical government.
For those in need of a little context:
A well regulated militia, being necessary to the security of a free state, the right of the people to keep and bear arms, shall not be infringed."
I am thrilled that there are designated militias to protect me from vigilantes.
I can just hear it now:
“Yes your honor, I shot my cheatin’ scum of a wife as I determined her to be a threat to the security of our free state and am therefore not prosecutable under the 2nd Amendment. See ya later.”
“Well regulated militia” and “vigilantes” are pretty much at the opposite ends of the spectrum.