To quote this article from The Washington Post by David Kopel:
In the American colonies, however, there do not appear to have been arms restrictions aimed at Catholics, except for one episode in Maryland in the early 18th century, during Queen Anne’s War. James Madison aimed to make sure that religious restrictions on the right to arms could never be allowed in the United States. Madison’s notes for his speech in Congress introducing the Bill of Rights explained that the proposals were to deal with the “omission of guards in favr. of rights & libertys.” His amendments “relate 1st. to private rights.” A Bill of Rights was “useful–not essential.” There was a “fallacy on both sides–especy as to English Decln. of Rts.” First, the Declaration was a “mere act of parlt.” Second, the English Declaration was too narrow; it omitted certain rights and protected others too narrowly. In particular, there was “no freedom of press–Conscience.” There was no prohibition on “Gl. Warrants” and no protection for “Habs. corpus.” Nor was there a guarantee of “jury in Civil Causes” or a ban on “criml. attainders.” Lastly, the Declaration protected only “arms to Protestts.” Thus, the Second Amendment contains none of the limitations or exceptions of its English ancestor.