He's an adult. He is responsible for his own actions and life. Divorce is to put an end to the relationship. While you would of course never treat him as he has treated you, you have to Let Go thoughts of caretaking him, looking out for his interests, or being overly fair. Doing so would be sabotaging yourself. You have to protect yourself.
Have you heard of Brinkmanship? One definition ... trying to achieve an advantageous outcome by pushing dangerous events to the brink of active conflict. That's what your H did in the past. Every time you relented and caved to, or didn't act on, his poor behaviors. He surely noticed that he was able to weaken your boundaries, as inexperienced as you were. So he kept pushing your boundaries until finally you had to exit. In effect, your exit was you setting a new boundary.
You were not the one who failed. He failed the marriage. You tried, for years. You did what you could, especially since you didn't have the education on how to deal with a spouse who was behaving poorly. Even though your marriage failed, there is still a lot to learn on our
Tools and Skills workshops board.