The second amendment doesn't limit gun ownership to the militia. It merely mentions the militia as one reason for the amendment. The amendment clearly states the right of "the people" shall not be infringed. "The people" is used throughout the Constitution to include all people.
Read the Federalist Papers and you will see all the contemporary thinking on the subject.
Cogito, ergo armatum sum