The reanimation of dead body's (also referred to as wights) happens when a white walker uses his magic to do so.
Which can be seen here.
At the end of season 6...
we see Benjen Stark telling Bran that the wall is more than just ice, the same magic that keeps him alive also keeps him from passing it. So the wall blocks (certain) magic.
Considering that the reanimation is magical, this explains why none of that happens south of the wall.
As for the reanimation at Castle Black, one could speculate that the corpse had already been turned into a wight and was left as a trap or that the magic still works there because the castle is built in/against the wall.
Or this could simply be an error by the producers, seeing as this happened a few seasons/years ago, they could have overseen such an event.
Still, a real answer why it happened at castle black is not available through the information of the tv show.
Credits to Kuhl:
The corpse that reanimated at Castle Black was found beyond the wall and had blue eyes when it was found, so its safe to assume that the corpse was already turned into a wight at that point and was left as a trap.
The information about the magic of the wall was only given in the last episode of the last season, very little is known about this magic, the magic casted on the wall and the magic and nature of the white walkers.