It seems like a lot of questions are focused on your BW, Sam. I'm not saying it's wrong to focus on your wife. Yet at the same time, the root of the why comes from within.
What made you think it was okay to do what you did?
What was missing inside of you that you were trying to fulfill in such a dysfunctional manner? (A hint on this one: whatever was missing/broken was in that state of prior to you even meeting your wife - think back that far.)
Hope this helps. Best of luck to you.