It kinda seem to me that what it is saying is that only people who are part of militias should carry arms.
The militia is currently defined by Congress as every adult male over the age of 18.
Also, you're not reading that correctly in any case.
It's not saying "for
as long as a militia is necessary, let those people have guns."
It's saying, "a militia
is necessary. For that reason,
the people (which is the same term used to apply every other universal constitutional right in the document to the full citizenry of the US) cannot be prevented from bearing arms."
EDIT: Correction, according to 10 USC § 311 -
(a) The militia of the United States consists of all able-bodied males at least 17 years of age and, except as provided in section 313 of title 32, under 45 years of age who are, or who have made a declaration of intention to become, citizens of the United States and of female citizens of the United States who are members of the National Guard.
(b) The classes of the militia are—
(1) the organized militia, which consists of the National Guard and the Naval Militia; and
(2) the unorganized militia, which consists of the members of the militia who are not members of the National Guard or the Naval Militia.