Generally speaking fasting is to deprive ourselves of food and drink. Occasion and motives may vary. One may fast out of personal devotion, mourning or ascetism. In the Church, fasting, together with prayer and almsgiving, is one of the expressions of man's humility before God. Christ denounces fasting or any good deeds done out of pride that is " in order to be seen by men." Fasting should be practiced with perfect discretion.
The disciples of John the Baptist and the Pharisees fasted twice a week as defined by the Law and the prophets which was also one of the elements of justification. However, this practice can become ostentatious, a public show of one's piety. We cannot become justified by our own merit and goodness. Christ insists more on detachment from wealth and self-renunciation because he came to fulfill our justification.
There is yet another reason for fasting, the one Jesus mentions in the Gospel. It is the fasting of the faith, the absence of the bridegroom and the continuous search for him. While waiting for the return of the bridegroom, penitential fasting has its place in Church practice.
Thus to fast can mean not only because we are repentant of our sins but also we want to feel closer to God by the presence of Jesus in our lives. We fast because we love him and we long for his presence.