Simple wooden palisade has lot of sense, even if we look at casters as artillery. For most smaller towns and villages, main dangers are small bandit groups, local wildlife, occasional thief, or in fantasy settings, single or small group of wandering monsters.
In real world, palisades were used well into mid 19th century. Only in late 19th, early 20th century, we started switching from walls and forts to trenches. But if you look at FOBs from GWOT era, they were built with modern version of palisade walls, just different materials. Purpose was same. Stop low level threats and control flow of people.