Mordenkainen's Sword is weak, but maybe that's not a bad thing
As explained in the other answers, Mordenkainen's Sword very clearly falls short of both an upcast Spiritual Weapon or an upcast Bigby's Hand (doubly insulting, considering Bigby was Mordenkainens henchman and apprentice).
Spiritual Weapon can be expected to do comparable damage using a spell slot one level lower, and not hogging your concentration (and you can use lower level spell slots with it, making it more flexible, too), and Bigby's Hand does over 60% more damage if upcast to the same level, and has a lot of other utility, too. All of them deal force damage, so there is no advantage in that.
Considering the damage output from Bigby's Hand at 5th level for a typcial fight, a power-adjusted level for Mordenkainen's Sword would likly be around 5th level -- it is slightly higher, but lacks the versatility of the hand. So, why is it on 7th level instead? Or why does it not deal more damage?
History of Mordenkainen's Sword
I think the first question has it answer in history. Mordenkainen's Sword has been around since the first edition of the PHB, and back then was put in 7th level. During that time, it did 5-20 damage (5d4, average 12.5) to medium or smaller and 5-30 damage (5d6, average 17.5) to larger creatures, and hit points were a lot lower back then. For example a Hill Giant had 8d8+1d2 hp, or an average of 37.5, so with a bit of luck you could kill one with just two hits. Compare this to the 5e sword, where the Hill Giant has 105 hit points, and you need about six hits to kill them, three times as many. So, historically, the spell could be said to have done two or three times as much effective damage, and if it still did, it would be on par or better with an upcast Bigby's Hand.
In the original version, there were also monsters that could only be hit by +3 or better weapons, and like in today's game, many of them had resistances or immunities against damage types like cold or fire. So sword could hit them, and therefore was an important tool to ensure damage got through, just like magic missile. Level seven was appropriate. And while the designers did shift the levels of some spells (for example, Bigby's Hand was a whole collection of spells spread over many levels, and still reflected in today's modes), the default is to have them at the same level as they always were.
Why then does the new sword deal so little damage, why not 5d10 or 6d10? I do not have a direct answer to that.
Not all spells need to be perfectly balanced
However, I think that there is not only downside in not entirely balancing all spells, in having some signature spells like fireball, that are slightly too good for their level, and others, like this one, that are slightly (or even significantly) too weak.
Firstly, how important optimization is depends very much on play style. In the end, the DMs task is to present his players with exciting, adequate and challenging encounters, but not to overwhelm them. If a party happens to select a lot of sub-optimal or weak spells or character options, and as a result is weaker than a more optimized one, that does not have to be a bad thing. The DM can just tone down the power level or number of the opponents. In that context, if your character concept is to have a wizard that can fight with a cool, magical floating sword, Mordenkainen's Sword is the perfect spell for you. The spell has great flavor.
Secondly, even for players who like to optimize, having stronger and weaker spells is a benefit. If everything was perfectly balanced, there would nothing to be optimized, and nothing to be gained from mastery of the game system and from understanding what is powerful and what is not. Having stronger and weaker spells allows players to discover the internal structure of the game, and be rewarded by being able to build stronger characters. Once you realize that Mordenkainen's Sword is a joke for a 7th level spell, and Simulacrum is entirely over the top, you can make use of it in your spell selection.