"A well regulated militia, being necessary to the security of a free state, the right of the People to keep and bear arms, shall not be infringed."
This is one sentence. The authors could have put these ideas into two sentences but they wanted these two ideas to be joined. The first clause is a modifying clause. That means it significantly impacts the meaning of the sentence. So, yes; we do have the right to keep and bear arms, but they have to be regulated! Doesn't it make sense that guns should be at least as well regulated as automobiles? So guns must be registered, and people must be vetted and trained in the proper use to protect themselves and the free state.
Look at Switzerland as the prototype. All adult males participate in military service, all own weapons, and weapons are registered and tightly controlled.
The constitution does guarantee the rights of citizens to own and bear arms. It doesn't promise that any damn fool can do anything he wants with them.