You can believe either of those reasons as you wish, but what is clear is that the amendment admits the people's right to keep and bear arms, at least until it is repealed.
As I wrote recently on another thread, the right to bear arms does not depend on the need for a militia; the existence of a militia depends on the right to bear arms.