A friend of mine once had an affair. It was long ago, and I can't remember how it came about, but she told me something I would have never thought of. She said that once it started, the only way she could allay the terrible guilt was to convince herself it was a viable option and continue it. The only thing that alleviated her horrible feelings was being with the guy she had an affair with - although it compounded the guilt.
Perhaps your wife experienced something similar?