It's damn hard to do a proper apology.
It's not "I'm sorry, but (here's why I did it)." That turns the attention to you and nullifies the apology.
And yes, I fight the compulsion to justify myself.
Example proper apologies:
"I'm sorry. I shouldn't have done that."
"I'm sorry. It won't happen again."
"I'm sorry. What can I do to make things right?"
If the other person doesn't accept a proper apology, then that's their choice. But it shows a certain lack of class.
Some years ago, I had a couple of kids, almost teens, filling my hallway with ice and snow, through the letterbox, on purpose. I got them redhanded. One of them offered an apology with a huge smile. I told him I was really cross, and would accept a sincere apology from him later, not now. Because now he was sorry that I got him, I wanted him to be sorry for what he did.
Ten minutes later, I got a more sincere apology, and I accepted it.