One of the most difficult aspects of the spiritual life is our constant backsliding. Now while I'm sure I'm not alone in this, I do know that many who walk this road have progressed far beyond me and what I say here is largely irrelevant. But those of us who are beginning, or even who are a bit progressed find that time after time we commit the same errors or sins regardless of our desire not to do so.
The only good thing about this is that it shows we are human. St. Paul tells us concerning himself, "The Spirit is willing, but the flesh is weak." Most of us who return to sin return to a sensual sense. That is the appeal to the pleasure principle is largely responsible for much backsliding. It only makes sense. If a sin causes pain, anguish, or mental difficulty, one is unlikely to repeat it over and over again. However, if a sin gives rise to some form of pleasure, be it gustatory, sexual, or otherwise, then we will be inclined to repeat the sin, not for the sake of sinning but for the sake of pleasure.
St. John of the Cross is always regarded as a very cold and austere Saint--one who might have supported various practices of mortification. In fact, he warned his adherents against excessive mortifications, and charted a road that is a model of moderation and caution in this regard. He pointed out the value of not allowing yourself to have something you greatly desire in order not to feed the fires of the passion that can lead to sin.
Practices of penance and mortification are good in small degree (so long as they do not become obsessions) in that they train us not to seek out the pleasures in life and to accept those pleasures that come without actively seeking them. When we experience a moment of pleasure at a sunset, a concert, or in any of the various activities of life, we should appreciate it and let it go. Mortification allows us to do this to greater degree. In some sense, we train our bodies to be more grateful and more appreciative of the good things that come to us. Fasting, for example, has numerous spiritual effects, but for those of proper frame of mind and prayer, one of the benefits is that it teaches us to be detached from the sensual pleasure accompanying food. This is not to say we should not enjoy the food we have, but we should not seek it out to the exclusion of all else.
In the document "Penitential Practices for Today's Catholics" mortification is described as
radical self-denial and wholehearted giving of oneself to God that Jesus called for when he told his disciples, "Whoever wishes to come after me must deny himself, take up his cross, and follow me" (Mt. 16:24). More specifically, mortification is a form of ascetic discipline that involves denial of some kind of enjoyment in order to gain greater detachment from one's desire. The goal of mortification is fullness of life, not death--freedom, not enslavement.
The word itself suggest dark, medieval practices from the "bad old days" of the Ancient Church. Monks with flagelli, etc. But it need not be so, and indeed, in some cases such practices carried things to such an extreme that mortification became an end in itself.
During Lent we are often called upon to "give something up." In modern Church discipline this "negative" approach has often been replaced with "doing something good." However, the discipline of giving something up, is very beneficial, and the proper practice of it can lead to lifelong spiritual benefits. If the point of the discipline is not simply to deprive oneself of a known good in order to be deprived but to use that deprivation to move closer to the Lord Jesus, "giving something up" can be a very good discipline indeed.
The long and the short of it--if you find yourself in a recidivist cycle, consult your spiritual director. Find out how to gradually increase your detachment from the object of desire, and use the whole practice to put yourself more thoroughly into the arms of our Savior and Lord.