What a nightmare you've been through! I think that you're asking me what you missed in order to protect yourself from making a similar mistake in the future. That's what we'll work on.
I notice that you put a question mark after your sentence, 'I know I married him for all the right reasons?' I think that you inserted the question mark because you unconsciously know that you didn't marry him for all the right reasons. Let's go with that assumption for a moment and think back to your courtship.
What warning signs did you ignore? Many times we choose someone who we know isn't right for us precisely because we are in the grips of a repetition compulsion. The repetition compulsion is the uncontrollable urge to recreate the most painful parts of our childhood in an attempt to heal the wound.
The first step in the recreation process is choosing a lover or spouse who emotionally resembles the parent who let us down. I call this 'setting the stage. ' Because the person we choose is similar to our parent, we soon experience the same hurt and disappointment that we did when we were young.
Once our childhood is recreated, we struggle to obtain what I call, 'the happy ending, ' that is we struggle to get our spouse to give us the emotional goodies that we didn't receive when we were children. If, for example, you grew up with an abusive father, you would choose an abuser, all the while yearning that he will magically become kind, thereby giving you the feeling that your abusive father became kind to you.
As you might have guessed by now, the repetition compulsion never yields a happy ending precisely because the people that we choose are as damaged as the parents who let us down, which means that they aren't able to give us any better treatment than our parents did. So when you said that you chose your husband for all the wrong reasons, you are really saying that your unconscious knew that he was exactly like your mom or dad and that you knew that he was going to let you down.
To protect yourself from future bad choices, you need to heal the wound that fuels your repetition compulsion. The best way to heal such a wound is in individual or group therapy. In a safe therapeutic setting you will experience the love and acceptance that you have yearned for your entire life.
When the void inside you is filled and the wounds are healed, you won't be driven to make a wrong choice ever again.