Please stop being so hard on yourself. Yes, there are things you could have done differently; but, there are also things your wife could have done differently. The important thing is that you are able to see those things, learn from them, and not repeat them in your next relationship, whether that is w/ your wife or someone else.
That's always the hard part, realizing that there WERE many things she could have done differently.
And holding her accountable for them, or at least giving them to her.