No, it's not. It's to give the people a means to defend themselves from the government.
The "well regulated" part is with respect to the militia, not gun ownership. The 2nd also doesn't say you need to be in a militia to own a gun. It just says that because a militia is necessary to protect the people from the government, your right to own guns shall not be infringed in case you DO need to join a militia. It's bullshit and outdated, but that doesn't mean it doesn't say what it says.