It is written by THE SPIRIT in Genesis chapter 3:
22 Then the LORD God said, “Behold, the man has become like one of Us, to know good and evil. And now, lest he put out his hand and take also of the tree of life, and eat, and live forever”—
23 therefore the LORD God sent him out of the garden of Eden to till the ground from which he was taken.
24 So He drove out the man; and He placed cherubim at the east of the garden of Eden, and a flaming sword which turned every way, to guard the way to the tree of life.
FATHER instituted the idea of restricted access in Genesis chapter 3, when HE placed cherubim to guard the way to the tree of life. Since then, FATHER instructed man to build walls, fences, and doors to restrict access and only allow those who were given legal access to enter through the barriers of separation. It always gets back to the simplicity of intent and to provide a barrier of protection against those who try to place self interest above the intent of ownership and rights of the restricted area. Our Heavenly Father owns the tree of life and has the right to restrict access to it. The cherubim were instructed to enforce that right of restricted access. This is a continuous theme throughout Scripture and Jesus reconfirmed the need for walls and doors when He spoke in John chapter 10:
1 “Most assuredly, I say to you, he who does not enter the sheepfold by the door, but climbs up some other way, the same is a thief and a robber.
2 But he who enters by the door is the shepherd of the sheep.
3 To him the doorkeeper opens, and the sheep hear his voice; and he calls his own sheep by name and leads them out.
4 And when he brings out his own sheep, he goes before them; and the sheep follow him, for they know his voice.
5 Yet they will by no means follow a stranger, but will flee from him, for they do not know the voice of strangers.”
6 Jesus used this illustration, but they did not understand the things which He spoke to them.
Walls function to protect us from lawlessness and provide a means of assessing transparency of those who wish to enter in. Jesus exercises His right to protect His sheep from those who have self interest as their guiding force. The Creator of Heaven and earth was the first to utilize barriers to entry thus we should embrace HIS methodology as well. The basic function of a wall is to direct us to a door… Jesus Christ.