What is a sweet pain, exactly?
Endorphins and flow experience I suppose. Seems adaptive enough to have some mechanism for overcoming short-term distress for the sake of long-term gains, but like most things, this can be taken to extremes. There's some debate regarding the status of masochism within the normal–abnormal spectrum. See also internalization, which includes self-harm among other forms of maladaptation.