بسم الله الرحمن الرحيم
The wisdom as it pertains to the legislation of fasting is that therein is a purification, cleansing, and expurgation of the soul from evil mixtures and offensive manners, due to it narrowing the passage ways of the devil within the body of man. As the devil flows through the descendant of Adam via blood vessels. As a result when he eats and drinks his soul expands (being delighted) with lusts, its will weakens, and its enthusiasm for enacting worship lessens, however fasting is opposite to that.
Thus in fasting there is abstention from the worldly life and the souls lusts, and therein is a craving for the next life. Also therein is incentive in sympathizing more with the poor and being conscious of their pain, due to what the fasting person tastes from the pains of hunger and thirst. This is because fasting in the legislation is to refrain, by way of intention, from specific things i.e., food, drink, sexual relations, and similar to that from what is reported in the legislation. Also pursuant to that is the refraining from obscenity and sinful acts.
Translated by Abu Abdil Waahid Najeeb ibn Yusuf Al Anjelesi
Source: الملخص الفقهي