You're not crazy, although the reasons are pretty vague, and I think more study could be helpful. In my sect of Hinduism, some do a penance called kavadi, which involves temporary body piercing with metal skewers while petitioning the deity. There are many less painful penances as well, like rolling around a temple, or fasting. There are 3 main religious reasons for it. The first is to rid yourself of guilt from past misdeeds that are hanging on you, as in a karmic load on your shoulders. So, by doing penance, you pay off some of that karma, lessening the guilt, so you can continue on the path, less burdened. The second is you sense upcoming troubles, and then it is a prepay of the karma, to reduce the impending disaster. This one is more on the intuitive level. The third one is a specific prayer, and a 'deal' with the deity. It can be something like your child is kidnapped, and you want he/she home, so you promise the deity that you'll do such and such a penance.
There are also two non-religious reasons for it. The first it to just show off to everyone around how tough you are. The other is overly beating yourself up, which is a mental illness. To avoid that, generally penance is done under the guidance of a spiritual mentor, and not assigned by oneself. We don't believe in negative spirits so that's never a reason, but I can see how it would be for those who do believe in that. I think grounding is better for that sort of elevated emotion. The general method for grounding in Hinduism is to work the land, or do work with your hands, like a hobby. Gardening is an excellent choice.
Best wishes on it.