Don’t get me started on marriage. While you may have a ceremony in a church, marriage is fundamentally a legal agreement. It is also betting half your stuff and the time you get to spend with your kids on the chance that your spouse is “the one”. I lost that bet. I loved my wife with all my heart, was always faithful to her and she still treated me like crap.
If you had premarital sex, you started your marriage with the deck stacked against you.
You have said things that give hints to possible issues, but I’m not going to presume to understand what happened, and I’ve never liked the bromide that when a marriage breaks up, both parties contributed....usually true, but not necessarily: It take two to make a marriage work, but it only takes one to destroy it.
Marriage really isn’t a bet, it’s a commitment. I’m not questioning your commitment, only you know that. But I will say this - modern attitudes about sex, including sex education, has done a lot of damage to a lot of marriages. And I’m not talking about gay marriage, either.