"Walls keep the colony defended from nearby enemies."
Wood Walls are the fundamental defensive unit of the game and are available from the start of the game. Walls are relatively inexpensive and have no maintenance cost aside from costs incurred to repair them if damaged. A wall cannot be infected and must be destroyed. Most infected cannot bypass a wall, and will tend to attack any wall within range of their attacks to the exclusion of other activity. Most units on the other hand can fire over walls to attack infected on the other side. As such, walls are the most effective way to slow infected and at the same time protect your units and buildings.
However, walls have no watch radius and can on their own do nothing to stop an infected from eventually breaking through. Worse, a wall not only will attract infected that stray close enough that is in their watch range, increasing the number of infected that discover your settlement, a wall that is being attacked produces significant noise that will lure yet more infected to investigate.
The maximum amount of walls which can be directly adjacent in 3 directions is two. It is not possible to build a 3x3 block of walls, or even have two rows of walls more than 3 long meet at a right angle. If you attempt to place a wall that would violate this rule, the message "Too many walls in the same area. Three rows of walls are not allowed" appears. Thus, while you can build a double row of walls, you cannot build a three rows of walls without placing a gap between them.
Walls going straight vertically or horizontally appear to be three wide, but do not in fact violate this rule, as they are actually not straight walls but a series of short walls zig-zagging across the map.
Wooden Walls can be upgraded to Stone Walls.