Let's make another Amendment with the same sentence structure as the Second...
"A well-educated electorate being necessary to the preservation of a free society, the right of the people to read and compose books shall not be infringed."
Obviously this does not mean that only well-educated voters have the right to read or write books. Nor does it mean that the right to read books of one's choosing can be restricted to only those subjects which lead to a well-educated electorate.
The purpose of this provision is: although not everyone may end up being well-educated, enough people will become well-educated to preserve a free society.
Nor can it be construed to deny one's pre-existing right to read books if there are not enough well-educated people to be found. The right to read books of one's choosing is not granted by the above statement. The rationale given is only one reason for not abridging that right, there are others as well.
Similarly the Second Amendment states, the people from whom a necessary and well-regulated militia will be composed, shall not have their right to keep and bear arms infringed.
It was the Founders' desire "that every man be armed" such that from the "whole body of the people" (militia) a sufficient number would serve in the well-regulated militia.