The constitution was first formulated when much of the US was sparsely populated and without a police force.
I believe that what it actually says of carrying guns is something on the lines of "a well-organised armed militia is necessary for the maintenance of order". When you look a little more closely into that, a militia is a picked body of men of good reputation who can be called on swiftly in an emergency, and have been trained to use guns properly, the guns being kept under lock and key in a central place and issued to them when necessary. It is not every man and boy (or woman or girl) in the neighbourhood who wishes to own a gun and fire it and keep it handy, whether or not they have the skill to use it and the wisdom to refrain.