A comma merely indicates a slight pause when reading. It can separate a main thought from an explanitory or expansionary aside. Punctuation and spelling were indifferent at best in the late 1700s and there actually exist two different "official" versions of the second amendment, one with 3 commas and one with only one. The 3 comma version is the one written out by the clerk of the House, AFTER the House and Senate had separately approved single comman versions. No other contemporanous version has those 3 commas. They all have only one comma, after "state". The version sent to the states, or at the one surviving example, has only the one comma, as do versions sent back from several states to the federal government with their official ratification. There has already been a FR thread on the subject of the commas.
IMHO, only the single comma version makes grammatical sense if the comma(s) is(are) supposed to separate separate thoughts. Since the single comma version is the one passed by both houses of Congress, and as far as we can tell the one sent to the states for ratification, it is the definitive version.
From the article/thread linked above:
It is important to use the proper Second Amendment because it is clearly and flawlessly written in its original form. Also, the function of the words, "a well regulated militia being necessary to the security of a free state," are readily discerned when the proper punctuation is used. On the other hand, the gratuitous addition of commas serve only to render the sentence grammatically incorrect and unnecessarily ambiguous.
There is only one comma in the original. AFAIK, two commas were added by FDR.