"A well regulated militia being necessary to the security a free state" proceeds the "Right to keep and bear arms" clause of the second amendment. Various lawyers have argued this qualifying clause reduces the second amendment to merely the right to join the National Guard. That idea merely displays ignorance on the part of lawyers. Militia was always a bring your own gun thing. Militiamen (all able bodied men of the community) were required to take the musket down from over the mantle piece when the militia mustered. The town, county, or state did not issue arms, members had to furnish their own. In fact there were laws requiring all citizens to possess serviceable firearms in case Indians, pirates, redcoats, rebellion, oppression, or riots caused the militia to be mustered.
The second amendment should be read as "In order to have a militia, the citizens must be allowed to keep and bear arms, because mustering the militia without arms is pointless."