The constitution was written when a rifle was a single shot black powder. CLThe foundational document of the US is the Constitution and the right to keep and bear arms is guaranteed by the Second Amendment to the Constitution.
Under the Constitution and subsequent laws, all able bodied males were, acknowledged to be part of the "militia" and they were expected to own, maintain, and use weapons in defense of themselves and their state.
Parts of the US are quite violent, though many cities in Mexico are even more so. If the gun violence that we see in inner cities is removed from crime statistics for the US, the level of gun violence plummets. IIRC, the stats fall in the mid-range of other first world nations. Handguns are used to kill far more frequently than long guns. More people are killed with fists, feet, and hands in a given year than are killed with rifles.