You might say that a farmer runs a "well-regulated farm" because things run smoothly. Or that the windmill was a "well-regulated machine."
The ability to form militias is so important, that everyone should have the right to bear arms, in order to enable this.
The idea is that it prevents the idea of a "special militia" having some selection criteria, so the government of the day cant make qualifying for its group a requirement to own guns.