Why was the Warwick Castle built?

To protect England from another war, it was an order from William the Conquerer.