With the right feats, a spearman can actually be viable in 3.5e. If you made some of these feats "normal features" of the longspear, it would go a long way to making it a popular weapons. Also, I think swords are popular because they are more often found in treasure. If your PC's discover magic weapons are common in the campaign, but magic swords are not, it may change what they favor.
From Net Book of Feats:
RANK FIGHTING [General: Offense]
You are trained to strike past friends using reach weapons
Prerequisite: Weapon proficiency with a reach weapon
Benefit: You can ignore the normal 50% cover provided by a friend in between you and your opponent when striking with a reach weapon. You make such attacks with no penalty.
Normal: A friend in the way of a reach weapon attack provides 50% cover, and thus gives a +4 bonus to the target's AC. The intervening creature takes no damage if struck instead. See 'Cover and Reach Weapons' in the Player's Handbook, page 132.
RANK FIGHTING Copyright 2001, Carl Cramér
Balance: 5.00 (Purp 5.00, Pow 5.00, Port 5.00, Comp 5.00, Rule 5.00)
SPEAR AND SHIELD [General: Defense]
You have trained in the use of a two-handed spear and shield together
Prerequisite: Shield Proficiency
Benefit: You can use a spear two-handed together with a large shield, despite the fact that such weapons normally can't be used together.
Notes: This feat is right at home in ancient Greece, where Hypaspists used it. The shield is slung over the shoulder and maneuvered with the offhand that simultaneously holds the spear.
SPEAR AND SHIELD Copyright 2001, Carl Cramér
Balance: 4.00 (Purp 4.00, Pow 4.50, Port 3.50, Comp 4.00, Rule 4.00)
NEAR AND FAR [General, Fighter]
Your skill with long weapons is extraordinary.
Benefit: When using a weapon with reach, you may attack adjacent foes as well as those within the reach of your weapon.
NEAR AND FAR Copyright 2001, Michael J. Kletch
Balance: 4.25 (Purp 4.50, Pow 4.00, Port 4.00, Comp 4.75, Rule 4.00)