There is a difference between remembering bad things to learn from them and turning them into something pathological.
To give you an example, a normal person would maybe walk across the road when the traffic light shows red and gets almost run over by a car. He will learn that it's not a smart thing to cross the road when the traffic light shows red.
The pathological "lesson" from it would be that it is dangerous to cross the road. These people do not learn from the experience in the normal sense. They do of course get the message that they should heed the traffic light, but they go way overboard with it. Not only do they blame themselves for everything that they did wrong, but for everything that did GO wrong. That the traffic light was red, that the driver did not watch out, and that's just the start. Things get added to the memory to make the experience even worse over time.
That's not really a healthy learning experience. In the end, their lesson is that it's probably better if they don't cross roads. Or maybe even better that they don't leave the house. In the most extreme form not even for their safety but to keep others from harm. After all, the driver that kills them could get hurt or he could have to deal with the guilt of killing someone.