There seems to be an impression here that spears do not penetrate armor as well as swords. This is certainly not true. The spear has three advantages over swords: lower cost, longer reach, more power. The power comes from the weight. When a spear impacts a target, all of the momentum in the long shaft turns into energy concentrated on the point. This is related to the principle behind the penetrating power of a battleaxe.

Swords, for most of history, were side arms. They were not preferred. Even Roman soldiers, who had perfected sword/shield tactics, were armed with some kind of spear or missile weapon (javelin) initially.

The most advanced spearmen in history may have been the Zulus. They solved the shield and spear dilemma by making their spears (iklwa, also incorrectly known as assegai) very short, long bladed (allowing slashing attacks), and well-balanced.