David is quite correct in saying that punctuation conventions change over time, as do other grammatical conventions, including spelling. In fact, though, there were two different versions of the Second Amendment to the United States Constitution. The one that was ratified by the states, and was approved by Thomas Jefferson, who was Secretary of State at the time, was:
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.
A different version was approved by Congress:
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.
Neither version had a hyphen, and, as David points out, the three-comma version approved by Congress is nonsensical by today's standards. Nevertheless, this is the version that we see in encyclopediae, textbooks, and other reference works. More importantly, though, since no single version of the amendment was approved by both the Congress and the states, the amendment is technically invalid.