I'm not surprised you are feeling bad - but feeling bad may not be such a bad thing - let me explain.
My guess is that you are feeling mixtures of embarrasment, anger and foolishness at what has come to pass - GOOD!! That's a sign that your conscience is troubling you - that is that you know that your actions don't line up with the values you want to live by. So step 1 - recognise where you have fallen short of your values:-
- You've broken the trust of your wife by having an affair
- You've abused your "mistress" by wrongly accusing her (twice)
- You've defrauded your employer by breaching the rules on phone use
Step 2 - take some time to write down what your values and principles are - work at it, refine it - ask yourself how you want to be seen, write the obituary you want to have, think of people you really admire - what is it about them that attracts you.
Step 3 - try and figure out what you need to actually DO to be showing these values - make a list - start DOING!
Step 4 - share all this with your wife - enlist her support, get her to hold you accountable for being the person of values you could be. Ask her to help you make real changes.
Let us know how you get on!!