To be clear, the "militia" at the time of the 2nd Amendment was “all able-bodied male citizens of the United States and all other able-bodied males who have . . . declared their intention to become citizens of the United States,” who were aged 16-45. Noting that average lifespans were much much lower, at that time, those over the age of 45 were considered elderly. If you look up the age range, some today are saying it's between 18-45, but that's not correct for that time. If you were to look at it by today's laws, you'd have to look at state restrictions, so 18+ would be more accurate, or even 21+ in some states.
Likewise, "regulated" in that form doesn't mean "legislated" or "commanded". "Regulated" meant trained or learned or experienced. Effectively, pre-revolutionary war, there weren't generally "standing militias". When you "call up" a militia you're effectively conscripting the able bodied males. The problem is, if those you call up have never handled a weapon and don't own a weapon of their own, they aren't particularly useful. In order to make them useful, you have to arm them, then you have to train them in how to use their weapons, THEN you have to train them on how to perform their battlefield duties. Not very effective when combatting sudden attack.
Keeping in mind that a standing federal military wasn't intended to be a thing at the founding of the nation, due to the risk of turning Presidents into dictators, and state-based standing armies were only intended to be minor at most, all of this makes a huge amount of sense. Unfortunately, we've gone all out on having a federal military, which takes most military activity powers away from the states, and has effectively removed most forms of heavier armament from the hands of citizens.