Since this thread seems to have revived...
A gun doing more damage than a melee weapon has more to do with the way we perceive hit points than damage proper. Part of the modern definition of hp is one's ability to turn a series of serious blows into lesser ones. The more hp you have, the longer you can last in battle. The more damage you deal, the shorter your opponent will remain in the fight.
We live in a society that is more aware of the lethality of guns than that of sword wounds, and are accustomed to medicinal science that can heal lacerations anmd superficial wounds that would have been lethal not so long ago.
It is thus understandable that we perceive guns as a weapon that is harder to turn a serious blow in a lesser one than, say, a sword. We can easily imagine how a sword can be parried, an arrow deflected with one shield, an armor taking the blunt of a hammer hit. Bullets are too fast to dodge and have too much penetrating power to be deflected by a shield or armor. People don't give a crap about realism in RPG, but many do insist on things being "relatable". Since it's easier to relate to a sword being parried than a bullet to be dodged, bullets do more damage than sword.
Does it have to be that way? Probably not, but "damage" is the main metric of a weapon's deadliness in D&D . Superior weapons deal more damage, and we know from history that guns made most other weapons obsolete for a variety of factors, but since D&D maily gives us one, the conclusion that gun = more damage is a natural one.