In Pokemon SoulSilver, I have a level 26 Gastly, but I know that he is meant to evolve at level 25. I don't know if this helps but he got to level 26 by Exp. Share, he hasn't done a battle on his own. Thanks.
Try levelling it up again. That should let it evolve.
Perhaps you pressed the B button as it was evolving - this cancels the evolution.