I'm sorry this is happening in your life.
Cheaters cheat because of something lacking in them, not in the person they cheat on.
Teach YOU a lesson?! What a bunch of manipulative, selfish malarkey! Accept none of that.
Chances are, what you've discovered is the tip of the iceberg. I highly suggest you get tested for sexually transmitted diseases immediately.
My best suggestions are to speak with your therapist. Secure all your bank accounts and anything in your name. Get an emergency fund built up in case you or he needs to move out. Password protect your computer and any shared accounts.
He's the one who destroyed trust. If he is still willing to try, he'll be willing to do the work to earn it back.
Hang in there. Take good self-care. Find supportive people outside the house to help you deal with the emotions. Don't let him get his serotonin rush by making you feel bad. Part of this behavior is the rush they get by sneaking around.
If you really want to set a firm boundary, you could take away his power in this manipulative game. A simple, non-emotional 'ok then. I didn't realize fidelity wasn't a part of our relationship. Well, now that I know we're operating by these rules, we can each do as we please. Have fun.'
Some of my friends have done this and two woke their partners up quick. Two others, though, discovered they didn't have the relationships they thought they did, and left to pursue happiness with someone more aligned with their value system. You'd have to decide what you're wanting, and whether or not he's capable and willing to be that.
Remember that if he's speaking hurtfully, you're under no obligation to stand there and listen. You have the option of exiting the conversation.
Hang in there. Ditto everything Alba said, as well.