it gives the right to bear arms to a "well regulated militia", not to people, not to individuals or home or business owners, that was to legislate for the raising of a police force. lawyers argued that you or your house or your family could be considered a militia, which is why you have guns now, but that was never the intention and its not even what the constitution says.
The Constitution, as with the Second Amendment, exists only in the context of its case law.
The case law states there is a Constitutional right to self-defense, and to possess a handgun pursuant to that right:
The Second Amendment protects an individual right to possess a
firearm unconnected with service in a militia, and to use that arm for
traditionally lawful purposes, such as self-defense within the home.
DISTRICT OF COLUMBIA v. HELLER