Our Lord begins by saying "when you fast", not "if you fast." He implies that His disciples will practice fasting (i.e., abstaining from food and perhaps fluids for an extended period of time). The hypocrites in Jesus' day made sure they looked like they were fasting by purposely neglecting to wash their faces and anoint their heads. They wanted to appear miserable so everyone would know what they were "enduring." Those who fast in this manner are not pleasing the Lord, and they won't derive any spiritual blessings from such. It is best to conceal one's fasting, if possible, since the act is intended for self-abasement, not the cultivation of pride.
Much can be learned about fasting by analyzing Bible examples of it. There appear to be both physical and spiritual reasons for fasting. Please reflect upon the following reasons with me.
1. WHEN A FRIEND OR LOVED ONE IS SICK , FASTING IS APPROPRIATE.
II Samuel 12:15,16 says - "And the LORD struck the child that Uriah's wife bore to David, and it became ill. David therefore pleaded with God for the child, and David fasted and went in and lay all night on the ground." David ended up fasting for a week in that context for his child who was ill. Also note Psalm 35:13.
2. WHEN A FRIEND OR LOVED ONE HAS DIED , FASTING IS APPROPRIATE.
"Then they took their bones and buried them under the tamarisk tree at Jabesh, and fasted seven days" (I Sam. 31:13). This fast was in regards to the death of King Saul and his sons.
3. WHEN ONE DESIRES TO SEEK THE LORD AND HIS BLESSINGS , FASTING IS APPROPRIATE.
There are times in life when one is in need of spiritual renewal or special help and guidance. Such times require a deeper focus that fasting can help provide. For example, consider II Chronicles 20:1-3 - "It happened after this that the people of Moab with the people of Ammon, and others with them besides the Ammonites, came to battle against Jehoshaphat...And Jehoshaphat feared, and set himself to seek the LORD, and proclaimed a fast throughout all Judah." A similar example is seen in Judges 20:26-27, although on this occasion the Israelites had already suffered great loss in battle. "...All the children of Israel...came to the house of God and wept. They sat there before the LORD and fasted that day until evening; and they offered burnt offerings and peace offerings before the LORD. So the children of Israel inquired of the LORD..." Also note Esther 4:3,16 and Acts 10:30; 13:1-3.
4. WHEN ONE IS GRIEVING OVER SOME CALAMITY , FASTING IS APPROPRIATE.
In Ezra 10:6 it is recorded that Ezra "ate no bread and drank no water, for he mourned because of the guilt of those in captivity." Also note Nehemiah 1:2ff and Daniel 6:18ff.
5. WHEN ONE IS REPENTING OF SIN, FASTING IS APPROPRIATE.
Jonah 3:5 records the penitence of the Ninevites after Jonah preached to them - "So the people of Ninevah believed God, proclaimed a fast, and put on sackcloth, from the greatest to the least of them." God saw that they had turned from their wickedness and relented from punishing them (3:10). Also note Acts 9:9.
I do not claim that the items on this list are exhaustive or mutually exclusive, though I do believe they cover the primary reasons why those of old fasted. I affirm that all of these reasons are still relevant for us today and that those seeking to do God's will should still fast at appropriate times (cf. Matt. 9:14,15). Fasting should be considered an aid to meditation and prayer (cf. Matt. 17:21; I Cor. 7:5). However, since the New Testament does not regulate the frequency or duration of fasting, such must be left up to each individual. We have no right to bind or create laws where the Lord has not, but we most certainly should stress the importance of fasting for those who are physically able to participate in such.