Walls are used to block out enemy units, or to help make your castle. You can use Wooden Wall, Curtain Wall or Stone Wall. Note however, that unlike in Stronghold 2, troops will still be able to attack Wooden wall so Stone Wall does not offer protection from attack like it previously did.
Another thing which you can do is create a rail. This will sit on top of a cliff, allowing you to attach wall to it. This is useful in case you'd like to build a wall acrros the edge of a ravine and cannot. The following is a screenshot of wall railing in the editor when placed:
There is one additional section in the "Walls" section called "Wall Enhancements", which contains the following enhancements:
Walls
Bastions
Towers
Engine Towers
Gatehouses
Defenses
Stairs
In Stronghold Crusader 2, the following walls are available:
Walls
Bastions
Engine Towers
Gatehouses
Defenses
Stairs