I think low self-esteem and guilt, a lovely combination handed out in schools and certain institutions since time immemorial is a major contributor. It happens to both self aware and rotten human beings alike because they think their mistakes are unforgivable or they refuse to move on as a result of something that happened to them.
Most times it apparently happens through negative experiences during psychological development, sometimes being told constantly as a child “you’re bad”, rather than “you’ve done a bad thing”, etc. Deep down, it is not themselves that they hate it is just the difficult situations that they are in and they respond negatively by hating and hurting.
Aggravating to the situation is when they are unwittingly and harshly judged, their self admitted guilt make them more aware of this judgement which drives the self hatred deeper!
Ultimately, self haters judge themselves and feel disappointed when they fail at even a tiny thing they attempt, whereas a person with confidence wouldn’t call it a failure because he/she is brave enough to try again and cope well in society.
People who hate themselves secretly wish for a stronger, more able personality, and they have every reason to, for therein lies the cure.