Swords were enormously useful.
The reason they were not as common as spears is simple: Cost.
Swords require much more metal to make, and are more difficult to make, than hammering out a pointy speartip from a small amount of metal.
Since swords were more expensive, if they were also less useful, nobody would have bothered taking them to a battlefield. They just would have made fancier spears.
So you have to ask yourself: Why did people bother with swords? The answer: They were useful.
As for axes, they can be used as both weapons of war and tools (unlike swords), and unlike both swords and spears, were useful against wooden shields.
This is quite an incorrect statement. Here's how it really went.
The Romans began by using spear and large shield, like the Greeks.
But once Rome's Republic grew larger and richer, they could afford to outfit more soldiers with short swords instead,
finding it a much more useful weapon in close quarters for stabbing around shields. So short sword+spear became the primary means of combat for legionaries. (Auxiliaries continued to mainly use spears, again for reasons of cost).
The Romans then continued to use the sword+shield method for like 300+ years, and fought with it against many, many spear-using enemies around the world. If it was no good they would have changed it in that time. They also never would have bothered to change from spears to swords in the first place if it was a worse and more expensive option!
Then,
the Crisis of the Third Century happened. Rome's economy broke down internally. They could no longer afford to produce and distribute massive amounts of swords.
And this is why the mass use of the gladius was phased out and replaced by the spear. Not because of Germanic tribes (who used swords plenty themselves).
In addition, spears do have a use against cavalry which swords do not. This gives them an additional use swords can't offer, even if they were not necessarily better in a straight melee fight between infantry.