Is that what was ratified as Article II of the Amendments to the Constitution?
The Second Amendment to the Constitution was ratified with but a single coma and appeared thusly; "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."
It is important when referencing the Second Amendment to use it in its clear and flawless original form. The gratuitous addition of commas serves only to render the sentence grammatically incorrect and unnecessarily ambiguous.
I think "being necessary to the security of a free state" is parenthetical either way, so the meaning should be no different.