I don't know how far back that goes, but I suspect quite a ways. I was in the army at a missile repair base out in the desert, back in the early 1960s. We were never armed, except when we were on "guard duty," stationed around the perimeter with its chain-linked fence and barbed wire. I put "guard duty" in parentheses, because we were issued rifles, but no ammunition.
And, yes, the MPs were armed, presumably so they could bring in any troublemakers when necessary. Their usual duty in my experience was dealing with drunks or speeders.
It's an old custom in most military organizations to keep the weapons in an armory, and only issue them when a battle is anticipated.
Sometime following WWI. But IIRC the officers were still allowed to carry side arms.
Bingo. Traditionally, soldiers were "the scum of the earth, enlisted for drink." And sailors were no better.
Officers were always a great deal more concerned about their own soldiers or seamen staging a mutiny than they were about somebody shooting up the base or ship. So access to weapons and ammunition was always tightly controlled. This is the actual origin of Marines, soldiers kept on board and at odds with the sailors. The Marines were armed to keep the sailors under control.
Of course, in the old days muzzle loading firearms made it very difficult for one person or a small group to shoot a bunch of people.
And yet, one would think Pearl Harbor might have changed all that. Obviously the easy way to take over any US military base is to take over the armory.
Under Jimmy Carter's military, we sailors practiced our riflery in 22-caliberusing the same 22 H&R model I'd used at a summer camp for boys!
In 1968, we had rifles locked into a glass locker on a small Naval Base in W. Germany.
Unauthorized persons were announced at our high-security location "climbing over the fence". A totally-unpracticed midnight response was made by us sailors. The key was thrown to meI unlocked the cabinetand the six of us ran out into the nightfully armed with real ammo and real Garands.
We were later commended for that response, although I never figured out how to load that M-1 clip into the underside of the M-1 Garand!
:-/