The legal framework of the United States rests on the constitution. The Constitution enshrines the right of the citizenry to keep and bear arms. Why?
The primary motivation was the awareness of oppression and persecution of the people by power in Europe (many settlers came to the United States to escape precisely this). The framers wanted to protect the rights of the citizenry and prevent this from happening again.
Obviously there are more details to fill in, such as the tension between state and federal powers, the influence of English common law, the notion of the free person as more fundamental than the state, etc.
But this is the historical context, so far as I understand it. And for the people of the time, in fact for any group of people who are relatively uniform in motivation and values, they can be trusted with this kind of right.
Unfortunately we live in a different time today. The culture and lifestyle is different. And it's natural to ask whether the assumptions made at the time of adoption really carry over today.
Many people think that the motivations still matter: It's still important to protect the rights and freedoms of individuals, that the balance of power between persons and the state needs to be safeguarded, etc. That people need to have the freedom to take on the duty of self-defense if they want to or need to, rather than being dependent, without choice, on the government.
I, and many others, think these motivations are important. However, I also believe these considerations are not the most important. They can be overruled by more pressing issues, one of them being a widespread and pervasive abuse of this right.
/rant