I suspect it's because they're young, immature, and hate the fact that (they) weren't "the first" to get showered by their mate.
In some instances it's about them feeling as though their partner has had more experience than them or they know the ex and find it hard not to imagine them being on the receiving end of one's love and affection first when they see him or her socially.
Needless to say most people get past that kind of thinking when they are beyond their late 20s and early 30s.
I can't imagine too many 40 or 50 year olds trying to compete with their mate's ex ghosts from the past. At some point it's silly.
(Unless their mate is constantly bringing up their ex)
No one wants to feel like they are a "rebound".
Note: Irrational jealousy is a "red flag" that shouldn't go unnoticed. No one can "undo" what they've already done.
You shouldn't feel obligated to "apologize" for your past!
Everything you've done is what led you up to this person.