Penance is an action or a discipline which is meant to strengthen a person, not just punish them. I can remember being told to say a bunch of Our Fathers and a bunch of Hail Marys when I was a kid. I could never figure how that was really going to do anything. I think it might have been a whole lot more effective, if I'd been told to write my own prayer, asking for God to give me strength, to recognize the problem the next time it came around, and to help me get past it or get through it in a more successful way. Maybe if I wrote my own prayer, instead of mindlessly repeating a stock one, it would have helped.
Penance is kind of like physical therapy, or like training.
The point is to build the person up, not tear them down. A penance might be to go and read a book, to help me understand what I did wrong, and to help me map out a different strategy for living. In the early Middle Ages, sometimes a person would be sent on a pilgrimage for their penance. By leaving the community, and going on a journey of prayer and exploration, they might come back a better person. Penance might mean taking some training, or joining a support group.