You didn’t ruin the relationship by having a past. Almost everyone does. What hurt him was finding out late and then seeing messages that made him feel like he didn’t fully know you. That shook his sense of security. But here’s the part people don’t like to hear once trust breaks, you can’t force it back to how it was. You can be honest, open, patient, and consistent, but you can’t make him become the person he was before.
If he’s choosing anger, control, and constant fights instead of healing, that’s not something you can fix alone. A relationship can’t survive on guilt and punishment. Talk to him calmly one last time. If he can’t let this go and move forward, you may have to accept that love sometimes changes, even when you didn’t mean for it to.