To be fair the sword is a romanticized weapon period. The spear has always been the favored weapon on the battle field due to how well it works in both formations and even one on one fights. A lot of people think "You just need to get in against someone with a spear" but in reality that isn't easy against someone knowledgeable in it's use.
This is very true, and usually it -was- that the common soldiers favored spears. That said, in European and Arabic warfare, swords and other metal-heavy weapons were in use a lot more because there was more metal to be found than in Japan.