What's missing is that the sword is just a massively more useful close combat weapon than a mace/hammer smashy thing or axe choppy thing. You have more vectors of attacks and are dangerous at a greater range of distances. You can jab, use heavier blows, backhand your attacks, use it defensively to fend off attackers, and you even have some options in a grapple. While it lacks in raw power to cleave through metal or stun an enemy in heavy armor, it reigns supreme in versatility (actual versatility, I mean, not just a damage bonus for 2-handed use). They also fit nicely in scabbards and can be drawn quick enough. Readying an axe or mace that is not in hand might be tricky in the midst of battle.
As others have noted, they aren't quite as useful against plated foes as some other weapons. They are also expensive and easy to nick, bend or break (either intentionally or unintentionally) so it behooves the well-armed gentleman to keep it in reserve and use another weapon for the start of the melee, bringing out the sword once you're disarmed or the fighting gets really frantic.
Digression: In an opposite vein, the simple spear was also one of the most popular weapons (if not the most) due to its ease of use, exceptional range, and utter affordability. If I had to fight a dragon (please don't make me), I would absolutely choose a spear (as long of one as I could comfortably wield) to keep the thing at range. Even an accidental bump from a multi-ton beast would be crushing.
Back on track: So, yes, I agree that the longsword is a bit underwhelming in 5e, especially compared to weapons like rapiers and hand crossbows which are too potent. At least we don't have to deal with spiked chain nonsense in this edition. I did allow sword wielders to inflict piercing damage if desired. It came up a lot in my first campaign since I was playing around with S/B/P damage types. I'd also support a strong feat or fighting style for sword specialists to differentiate them a bit more (at the cost of optional complexity).
But, in general, D&D weapons and armor have long been problematic (don't get me started on longbows) and if you go down the rabbit hole of improving things you'll never come out. Just roll your attacks and damage and kill them orcs.