Opinionator has a witty piece, titled Fanfare for the Comma Man, that looks at appropriate usage of commas. And, it talks about the Second Amendment!
You can glimpse a reason for this codification — which emphasized consistency rather than sound — by looking at the opening of theSecond Amendment of the Constitution (1789):
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.
There are three commas. The one after “state” would be used today; the one after “arms” would not; the one after “militia” is ambiguous; and all three have caused a world of hurt, confusion and argumentation over the last 223 years. As Adam Freedman wrote in this newspaper in 2007, a Federal District Court ruling invalidating the District of Columbia’s gun ban (subsequently upheld by the Supreme Court) held that “the second comma divides the amendment into two clauses: one ‘prefatory’ and the other ‘operative.’ On this reading, the bit about a well-regulated militia is just preliminary throat clearing; the framers don’t really get down to business until they start talking about ‘the right of the people … shall not be infringed.’” More generally, the funky comma protocol muddies the crucial link between the importance of militias and the right of people to bear arms.
As Nelson Lund, Eugene Volokh, and others have pointed out, it was a common drafting technique in the 18th century to include prefatory phrases in statutes that express some aspirational concept. The prefatory clause does not place a limitation on the operative clause–that is where the meat is at.