The Tulum wall, of uneven height following the contours of the terrain and rectangular in shape, protected the inhabitants, also allowing control over activities within the city.
In the same way, the wall separated the three hierarchies that divided society: rulers, craftsmen, and workers. Or, in other words: it separated the upper class or elite (nobility and specialists who lived inside) from the common people (workers who lived outside).
The wall surrounded the city on three sides, since the wall facing the beach and the Caribbean Sea naturally protected it. And it had five entrances: one to the west, two to the north, and two to the south. The entrances were very low because it was easier to defend that way, and the Maya themselves were short in stature.
The fortress wall was painted red, which symbolizes blood. They obtained the red color from cochineal (a type of insect) or cinnabar, mercury oxide. The red color made the fortified wall alive for the Maya. Touching it was forbidden, as it would lead to punishment by the gods and death. "If you don’t want the gods to f*** you, it’s better not to touch them," he said. Alvaro said this. Obviously, people died not as punishment from the gods, but from poisoning.
Sources:
https://pueblosoriginarios.com/meso/maya/sitios/tulum.html