Respuesta :
Castles were primarily built during the wars of the late Middle Ages for the purpose of protection.
The castles were used to protect the people of the kingdom or territory during a time of war.