The structure of the sentence doesn't specify militia membership as a pre-condition for keeping and bearing arms. It merely implies that a well regulated militia requires arms, that militias are composed of citizens and thus grants citizens the right to bear arms, implying that they thereby would be able to join together into a militia if they so chose.
I've always felt it works better if you flip that around, the "militia" part is a sort-of apology for not disarming the government. "Unfortunately, the ability of the government to command a militia is necessary to security, so the people must have the ability to defend themselves against abuses by that militia." "Government" in this case doesn't have to mean Federal, just a militias don't have to be national.
It makes less sense that people are armed in order to allow the government to call them up, since the government already has that power under Article 1; and indeed there were early laws requiring able-bodied free men to own a suitable weapon to join the militia.
In fact, the entire original BoR works better, IMO, when read as giving people the ability to plot against the government.
Freedom of the press, the literal printing press, in order to print pamphlets of grievances, in order to recruit. Freedom of religion, because churches were historically used recruit; and as havens to plot against tyrants, and thus control of churches a way to suppress such plots.
Absence of military intimidation of potential supporters. (A common tactic in the day. If there's unrest in the area, the govt houses troops on the land or even in the homes of sympathisers, consume their food, etc. As well as the less savoury aspects of having random soldiers set up in your home.)
The ability to hide documents, either at home or while travelling. To carry messages between conspirators, etc.
The right not to be compelled to testify against your fellow rebels. Nor to be held without charge or warrant. Or have your property arbitrarily seized. Etc. And to prevent jury-shopping by continually re-charging you even after you are acquitted.
Not to be held for an unlimited time, nor be prevented from being able to conduct a defence.
To have a jury of peers, not govt appointed judges, nor ring-ins brought in from loyalist areas.
Bail can't be used to get around the Sixth. Nor minor offences used to justify a major punishment.
And no cheating by sneaking laws into the gaps between the literal wording.