Because not wanting to think about that person has a story that matters to you – for example because they dropped your ice cream in the mud.
But the ice cream in the mud is a moment in your history that has a powerful meaning for you
So the story is more ‘real’ to you than the absence of that story
So your consciousness considers it more valuable to remember (if for no other reason than to protect you from people who may drop your ice cream in the future)
If you want to forget the story you need to replace it with something more meaningful or powerful for you. Perhaps by remembering a lovely ice cream you shared with a close friend.