I think part of the problem is the way spears are used in the game, part of it is the way the players have used them in these videos (it is rare enough that they stand still and when they do it is in a line...) and perhaps partly down to weapon stats as well. I noticed that the Imperial's War Spear had about 30 swing damage and 50 for thrusts, which seems strange for a spear. I would expect much better thrust damage relative to swing, and the sword actually has better thrust damage (as well as better swing). I wonder if the AI is choosing swords by default because of the superior stats and only switching to spears in certain situations. I don't know what actually triggers them to do so, but I think they are switching to swords when the enemy is close. But they aren't always failing to use spears against cavalry, and I saw one very efficient looking horse kill at 9:14 (though who knows, that might have been a player). This looks to me like another example of item stats which haven't been carefully selected.
I think the way the players in these videos use them is a problem. If I were playing on that map (and not using cav, like the Imperials in this vid), I would get my team mates to follow me through the arch on the left and go to the top of that low rise which overlooks the enemy plain (they didn't visit that part of the map in this particular video). I would have the archer group in the middle and a spear group sandwiching it, to protect from melee attacks. That position isn't really overlooked by anywhere that I've seen, so Khuzait arrows would mostly be hitting the big shields of the spearmen, and any attempt to charge would probably be slow enough to allow the infantry to kill the horsemen. Otherwise, if caught in a flatter area, I would have the infantry form circle and place the archers in the centre, so that the soldiers weren't easy to ride amongst and shoot/lance in the back. When the soldiers are moving about against cavalry, they don't always seem to have time to gauge distance properly or change weapon in time, though the swords seem effective enough at killing horses.
I would love to see spears used as the default. Sure, when pressed up against an enemy infantryman, get out your sword, but if your allies behind have their spears ready they can help you without having to put their spears away. Also, I think most of the time soldiers should keep their spears out when facing cavalry next to them, only changing if the cavalry remains next to them for more than a second, because most of the time it races past by the time the weapon has switched. And with the overhead attack, spears could probably be quite effective at attacking the rider even at very close range (because the overhead stab might not immediately bump into the horse like the underarm stab at close range is prone to do). Though again, moving in one direction (ordered by the player) while trying to stab in another direction at a charging horseman probably makes them mistime a lot of their attacks.