The main purpose of the Second Amendment was so the people, mainly the anti-federalists, had a final check on the power of government. If the contract of the Constitution was violated and someone tried to seize power like a King or to withhold the rights of the people, another armed revolution would be possible.
If the government was aware of this right, and knew that the population was armed, then they felt the government would be much less likely to take undemocratic actions for fear of popular revolt and overthrow.
We are a gun culture, and a very well armed society, with estimates of over 250 million guns in private hands, in a country of 310 million people. You can do the math on that one. The 2nd Amendment is both controversial and beloved by American citizens, who still defend it ardently, and support the National Rifle Association which is designed to do just that, to the extreme even.
Some people believe that, since we have a democratic tradition dating back over 200 years, and a military that would defend the Constitution before any individual President, that the 2nd Amendment should not be taken so literally. This view, of course, is also controversial.