No group of people can have a right that is not first possessed by each individual of that group, unto himself.If that were true, they would have written it that way.
But they didn't.
It simply says that the right of the people cannot be taken away or restricted. And it provides an explanation why... but makes no conditions on its mandate.
Even if somebody managed to prove that a well-regulated militia were NOT necessary for the security of a free states, the 2nd would still be a command that the right shall not be infringed. Period.
Much to the disappointment of left-wing fanatics.
The right of the people as a group, not as individuals, is what is guaranteed not to be infringed.
There is no such thing as people as a group, with the possible exception of a mob. People exist, live, die, as individuals, not as a group.