This is all true, but there is historical basis, explicit and implicit, from the writings at the time supporting the idea that at least one factor for the second amendment was the ability to defend against state oppression.
"It is a natural right which the people have reserved to themselves, confirmed by the Bill of Rights, to keep arms for their own defence; and as Mr. Blackstone observes, it is to be made use of when the sanctions of society and law are found insufficient to restrain the violence of oppression." - 1769 newspaper editorial.