I got a gastly from the Dream World in Black 1 and it knows Sludge Wave.
Now if I looked at the pokedex page properly I don't see sludge wave anywhere.
Why does he know it?
Its a special move.You have encountered a special gastly.See this page where you can see what Pokemon can have special moves and why.I think it is because they are so special that nintendo wanted some Pokemon to have special moves. The Attacks you obtain for the special Pokemon depend upon the score you achieved in the mini-games in the Dream World when you encounter the Pokémon.