In my experience, spears are less effective against undead and non-organic creatures (gabbro men and stuff like that), and slightly less effective against unarmored humanoids.
Creatures that are "non living" need to be killed via destruction of the head, lowerbody or upperbody, something that spears aren't the best at thanks to their low contact area. They still will eventually succeed, just not as quickly as slashing weapons.
The increased penetration of spears isn't really better at reaching the internal organs and nerves of small, unarmored creatures (like goblins) than swords or battleaxes, and those are much better at severing or destroying body parts, which can quickly cripple and kill an enemy, or make them bleed out. Spears will still get the job done, but just not as quickly.
There's not really much uses for spears. Swords are far more flexible, being effective against undead, inorganics, unarmored humanoids, armored humanoids and large, inorganic creatures. Meanwhile spears are only more effective against very large, fleshy creatures (megabeasts and some giant animals). And even then, you'll find that a megabeast will on average, die just as quickly to a squad of 10 dwarves hacking at it with swords as it will to 10 dwarves poking at it with spears. What I'm saying is that on an individual level, spears are more effective against big creatures, but when numbers are taken into account, the odds even themselves out. The only thing short swords aren't effective against is heavily armored humanoids (creatures wearing armor that is equal or stronger than your own weapons' material), something that spears aren't any more effective against and can only be fought with war hammers. But as long as you have steel (and aren't at war with other dwarves, which is very rare), you're not really going to run into that problem. If something spews webs, fire or other fun things, then hoping that a speardwarf will score a natural 20 and instantly kill it is a risky gamble. Never engage those in melee combat.
Oh, and stuck ins are also a big disadvantage, but people here have already explained why.