In many cases, building codes require parapet walls for safety reasons, especially on buildings with accessible rooftops or terraces.