In Federalist No. 29 of the Federalist Papers, Alexander Hamilton explained at great length precisely what a “well-regulated militia” was, why the Founding Fathers thought we needed one, and why they wanted to protect it from being disarmed by the federal government.
And although it was organized state by state, it needed to be under the explicit control of the national government. The “well-regulated militia” was under the command of the president. It was “the military arm” of the government.
These two (bolded) statements seem somewhat contradictory to me. I have also noticed that the 2nd doesn't say "the right of the militiamen to keep and bear arms shall not be infringed". Seems to me if that was what they meant, that was what they would have written.