From The Washington Post:
One reason the First and Second Amendments are good constitutional neighbors is that they both protect religious liberty. James Madison intended for the Second Amendment to prohibit the types of arms restrictions which the British government had sometimes imposed on Catholics.
The English Declaration of Rights, enacted by Parliament in 1689, had stated: “The subjects which are protestants may have arms for their defence suitable to their conditions as and allowed by law.â€