It seems like spears and pikes should be more effective weapons than a knife.
The Romans did use spears for a good portion of their early history. They adopted Greek-style Phalanxes from the Etruscans and continued to use dense spear formations all the way into the early Republic. After fighting the Celtiberian mercenaries in the Carthaginian army and the Gauls of northern Italy, both of whom used short swords, it was found that short swords were far more effective in close infantry combat than spears. The combination of the large, rectangular scutae and the gladii turned the front of the legion into essentially a meat grinder. The spear, for all it's power and reach, is somewhat slow and hindered in close quarters, allowing a man with a shield and short sword to get inside the spearman's guard and deliver quick thrusts around their shield.
Also, the Gladius Hispanensis is no knife; it is most certainly a sword. They ranged from about 25-35 inches in length and are effective at both cutting and thrusting though the latter was definitely it's best usage. If it weren't more effective than a spear the Romans would have just kept using spears.
I actually asked about this previously. I think /u/notsofst had a pretty good response.