The purpose of the second amendment is to protect the right of a free people to protect themselves. This includes self-defense, but is not limited to it. Understand the context in which the Bill of Rights was written. We had just fought a long war to overthrow British rule. This meant ordinary people, farmers and craftsmen, took up and used their personal firearms.
"A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed."
In the language of the day, a well regulated Militia means a well prepared body of men 18-55.
What the founders were saying was that for this country to remain free, all able-bodied persons must have access to a means for the personal defense of their freedoms: firearms.
The second amendment is critical to freedom because it enables free people to defend individual or collective freedom from tyranny. It enshrines a method of last resort when all else fails (as it did in the American colonies on April 19, 1775).