In fact, the pilgrims remember the action of the Prophet Ibrahim with the cursed Satan, when he attempted to cast doubts in the heart of Ibrahim.
Allah, the Almighty, has made sublime purposes for the legislation of the acts of worship. For example, regarding Prayer, Almighty Allah says:
And establish prayer. Indeed, prayer prohibits immorality and wrongdoing. (Al-`Ankabut 29:45)
Concerning fasting, Allah (Glory be to Him) says:
O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous. (Al-Baqarah 2:183)