When I'm still in the moment (and it can be a very long moment sometimes, weeks or years) where a memory is causing me a lot of pain, I would press the erase button, no question. And the pain does a lot of long-term damage, I have no doubt about that.
However...eventually the pain does go away, or 90%, or certainly enough to get on with life. And then, those memories do kind of fall into that "this has made me who I am" category. And losing them would mean some kind of loss, at least in terms of personal growth.
So it's really a tough question to answer. The way I would answer, about specific memories, depends very much where I am in the process of working through the pain associated with those memories. Trust me though, if you asked me when I was right in the middle of those memories and that pain, I would hit the erase button without a moment's hesitation - because that kind of pain can be terrible, debilitating agony for me and can lead to irrational behaviour and depression. I just think it's possible I would regret the erasing later.
I think though that some people hang onto situations and individuals in their lives because their memories inevitably become rosy. For instance, I simply don't understand the mindset whereby people keep exes around in their lives, even as acquaintances, who truly screwed them over. It's completely foreign to me. And I think in practise it means that you're not going to learn from your experiences, because they get into the same situations over and over. I certainly know people where that seems to be the case. I will never understand why you would want any type of acquaintanceship (unless absolutely necessary, like if you have a child) with someone who had cheated on you (at least systematically), for instance.
When I was still hurting over a breakup, I remember someone said to me "it's hard because you remember all the good times." I was like...well, that was more of a problem in the earlier stages after the breakup. Later, well, no. I might still have good memories, but they're more to do with the experience than the person (ie. I went to a fantastic play with my ex, and would have loved the play even alone.) The problem is more that I've realised that the guy is an ass and treated me badly, and I don't even like him as a person/friend, yet I'm still emotionally messed up over the whole thing and having difficulty moving on.