OP- I hope you can allow the dut to settle on this and get professional help then decide your future. it is a terrible shock, but I don't think it is helpful to rush into a decision.
I have to disagree withthose of you who say you can't be doing with "addictions and complexes.
Ok, it's a scale, but without naming names, some of you freely admit here that you have a few too many drinks, are a bit overweight, can't help tucking into the food etc. Sure, it's not the same as infidelity, and there is no deceit, but it's still an example, of you not being in control of your behaviour, and carrying on doing something which is not good for you! Long term, being obese etc will harm your health, and this will in turn afect your family!
So- those in glass houses...as they say!
I am trying to show that human behaviour is not as simple as you try to make out.
The OP's DH obviously wanted to be found out- that is clear. I think it was his way of crying for help.
Whether he can change remains to be seen, but it's not our place to be judge and jury.
Support yes. But a baying crowd urging someone to leave- just because we either cannot understand the behaviour, or understand it purely within the limitations of our own lives and morality- that's not the answer.