Fasting is prescribed so believers may grow in taqwa.
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُواْ كُتِبَ عَلَيۡكُمُ ٱلصِّيَامُ كَمَا كُتِبَ عَلَى ٱلَّذِينَ مِن قَبۡلِكُمۡ لَعَلَّكُمۡ تَتَّقُونَ ١٨٣
O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous