I interpret that sentence as containing two separate, individual statements of fact.
1) A well regulated Militia, being necessary to the security of a free State
2) the right of the people to keep an bear arms shall not be infringed.
If you do not have a citizentry which routinely bear arms you do not have a body of free citizens from which to call a militia. The militia is not a standing army, it is an emergency force that can be called on from the people in time of need. If you conscript people and give them rifles that is called a conscription and that it regular army, not militia.
Now if there is an emergency and the militia is called forward it will be a temporary army and officers will be designated and so forth, and that is what is referred to as a well regulated militia. It doesn't have the meaning that people in the general population should be regulated in any way.