One of the reasons was because after a "renowed" psychiatrist made a case about the themes and depictions in comic books turning the youth into juvenile delinquents, his garbage investigation got enough traction and he and others declared that the american comics were corrupting the young teaching them violence, drugs, sex and other things, the goverment responded by establishing the Comic Magazine Association of America, which instituted the Comics Code Authority, a censorship code to regulate what could be put or not on a comic. The most affected genres were comics about Horror, Crime, Science Fiction and other genres appealing to older readers or the ones that wanted more "mature" or "interesting" stories.
Specifically the part about guns went on as:
"excessive and unnecessary knife and gunplay, physical agony, gory and gruesome crime shall be eliminated."
"In every instance good shall triumph over evil and the criminal punished for his misdeeds"
this went on to impact a lot of characters in the superhero genre during decades by making allmost all the good guys never use guns, firearms or simmilar weapons, the ones tha used them would be the bad guys and even then they were greatly downplayed.
This shaped a lot of the actions and procedures of popular superheroes like Batman that made his origin story not only his motivation to combat crime, but also as a vow onto the "never use guns" trademark the character now is known for, this is depending on how it was/is tackled on seen as ridicuolous when badly executed or kind of restrained, because why wouldn't everyone carry a gun since its the most efficient/fastest way to incapacitate someone?, the thing is that a lot of heroes that have superpowers have no need for guns to incapacitate a criminal, and the ones that "are more normal", are supposed to be capable enough (i.e. expert martial artists or combatants) to incapacitate the criminals without outright killing them or make a massacre by killing each other with firearms, that also is the reason why a lot of them are tolerated/being permited to act by authorities (in universe) in the first place, because they aren't making cementeries full of gunned down criminals and henchmen.
As for Captain America, he is a soldier and also and enhanced human has used guns sometimes depending on the history and time of publication, but now most of the time he acts in teams or at least with a teammate and he doesn't tend to use guns since now he is depicted with even greater abilities, at first the superserum simply made him a "top human", now specially in the movies he has displayed superhuman strenght, stamina, recovery etc. and his shield not only it's made of one of the strongest materials in the universe perfect for defense, it's also used as a ranged weapon by throwing it and returning almost like a boomerang, it can also reflect energy attacks, lasers, beams or rays to his enemies, so it kinda outclasses using guns.
I attach the revived superman from "reing of the supermen" from decades ago he was going after the bad guy powerless so basically he used a lot of weapons in the final battle:
Last edited by foxmccloud64 - on 08 May 2021