You know that expression "the road to hell is paved with good intentions?" It's probably slightly overstated, but I think it's essentially true.
First of all, it's not often that we have the intention of hurting other people. And when we do, we know we're being bad. That's why in an argument you want to think long and hard before you say something cruel, because it's not going to work to say I didn't mean that afterwards. You can't take it back. Whether you meant it or not, your intentions weren't good.
In my experience, most of the time when someone uses the good intentions excuse, they were just as concerned--if not more concerned--with seeming helpful. That's why they get defensive rather than apologize.
I am no exception to this. Especially since I've dedicated my life to helping others. So you better be helped, damn it! And you better appreciate my help!
The other reason people say well-intended but unhelpful things is because they want you to stop hurting, but they don't know how to make that happen. So they tell you to stop in ways that are sometimes downright hurtful.
Some of my personal favorites are I'm suffering more than you, in response to my first divorce. And well, at least you have 3 other kids, in response to my brother's coma that resulted from falling out of the car when he was 4.
Some clients are aware of how offensive good intentions can be, so they ask for advice about what to say. I tell them to ask the person directly what they can do. Maybe the person won't know in that moment, but they know they can ask you for help when they need it.
The other thing I tell them is to listen carefully to what the person has to say. This isn't easy, because most of us aren't very good at bearing witness to other people's pain. So you have to practice by starting with yourself.
You know all those unhelpful things you say to yourself to try to feel better? You have to replace them with accepting, nonjudmental statements about how it's OK that you're upset. That it doesn't have to make sense. That you don't have to know the reason why. And that you will be by your side for as long as it takes until you start to feel better.
When we can be good to ourselves in this way, we will have more to offer than just good intentions.