So, I must speak bluntly here. It's not your ED that is ending your marriage, it's you. By not ignoring your 'why' questions and just creating intimacy with your wife. You may be in mourning or something over your sexuality but at the same time, there is much pleasure to be had from other intimacies And it feels wondering to give others pleasure. You need to get over your own mental issues and stop withholding love and intimacy from your partner. It is NOT ED at this point, it's you. You do not have to have intercourse to have a loving relationship with intimacy.
Also, there are medications and whatnot that helps with ED. You can talk to your doctor about that. But your issue is your own withholding of intimacy from HER. Which ya, that comes across as you don't care enough to get over your own mental blocks. So, make some changes in attitude and action and see if it helps.