To answer this, let's take a quick look at Merriam-Webster's definition of "art", specifically the section on synonyms:
ART, SKILL, CUNNING, ARTIFICE, CRAFT mean the faculty of executing well what one has devised.
If we look at the art of foleying—for this is what we're talking about—it's sort of interesting to note that it's always been at least as much a fashionable thing as a technological thing. In the earliest radio and recording days, there were very simple techniques used to foley, though I think nowadays we tend to underestimate how cunning the early artists got.
This Mystery Science Theater 3000 sketch is one of my favorite lampoonings illustrating your very question.
Now, why does anything sound the way it does in a movie? Do they record the actual thing in the actual environment and then play it? Almost never. And when that is done, it generally sounds cheap and lacks any kind of emotional impact which is after all the point of effects and movies generally.
Let's take a really blatant example that will reflect back on the gunshot question. In the '50s, a realistic rocket sounded like this. Fairly close given the limitations of the technology, right? And Rocketship X-M is mostly silent in space, but not completely—because boring!—and then in the late '60s with 2001 and Planet of the Apes, you got a lot of silence in space.
Then, of course, Star Wars comes along and all of a sudden ships are screaming through space right and left, and basically destroys the "silent space" thing for all but the most serious of sci-fi. The audience's expectations were forever changed.
Gun and fighting sounds present a bigger, subtler problem. If you've ever heard a fight, for example, you know it doesn't sound anything like a movie. If you've been in proximity to a gun, you know that not only does sound equipment not capture it, you probably wouldn't want to be in a theater where it was duplicated (as it would hurt your ears terribly).
So, if you're a foley, what do you do? You're not working in a vacuum. You can't just "be realistic", because—to answer your question finally—the audience won't buy it. What you have to do, most of the time, is what the audience expects. At the time, those KAPOING, POW and ZOINK sounds were shorthand for "this is an exciting and dangerous (but also fun) gun battle".
I often wondered where the ricochets were coming from, myself. What had been hit, and where had the bullet been deflected?
But you really answered your own question: Gun battles sounded like that because that's how gun battles sounded. It's why cars of the era were guaranteed to explode into fireballs when shot with bullets—because that's what cars are supposed to do when shot.
The more provocative thing to realize is that movies today are just as artificial in their tropes and effects, and a few years from now audiences will look back on current year movies and be just as amused.