You're doing everything he wants so why should he change. He has everything he wants. It all worked out for him and you're very compliant. I think you've fallen into this trap of....I do everything for him, I do everything he wants, he's the center of the world, why does he do this....well, he doesn't value you because you don't value yourself. He's a stinker, obviously, and he'd probably cheat on any other woman too because he has low character and morals. Cheating always comes down to a lack of morals, he's found lies he tells HIMSELF to excuse his behavior - we all have temptation but morals are what keeps the goods in our pants. He doesn't have those. IMO, and this is easy to say but...it's still true I think....you need to find your own self respect and self worth, decide what YOU want for YOU and your kids. What kind of life in general, and what specifics you need....FOR YOU....don't even factor him into your thinking....you have to make your own goals and fill your own needs at this point because he won't. He gets what he wants with no effort. That's the major change I'd make in you - have more respect for yourself and your worth, and decide what you want to do for you,and what you WON'T DO FOR HIM ANY MORE. He wants things done this way or that way....he can go to hell. Can you tell him to go to hell or are you too afraid, both emotionally and financially? Can you assert yourself with him, or anyone? Are you too afraid of losing him? That gives him power over you. This might be stuff you can work on with a counselor (hope you can get one I know how difficult it can be to get or afford good therapists - even on line might help though). I know when I was younger and a lot more screwed up (I'm still screwed up but less), even a lot of self help books helped me - there are resources on this site, and you can find others for cheap or free elsewhere, even a library. But you need to feel more confident about saying NO to him and other people and getting your own needs met.
What can you do about him? Not a damn thing. He may or may not respond to changes in YOU but this would be about you deciding what your life is gonna be like. To the extent you can with kids, of course. BUT you can't really control him, you can decide to divorce, which I usually advocate because it usually IS the best decision, but I know many can't because of kids, finances, the economy etc. So in that case you may decide to make the best of a bad situation, in which case you tell him that his behavior is unacceptable and you're gonna stop doing X,Y, and Z. I'd stop giving him any sex for one thing. Why should you share yourself and your intimacy with someone who abuses you. There has to be some trade-offs here where it's not him getting all he wants over and over. That shit has to stop.
As to why he's doing this. Well, my husband did stuff like this with the dating sites too. It's all he did, he didn't go physical (he does have something of an EA which he's had for years and which I've decided to ignore for my own financial security reasons - I understand not all of us can walk.) He does it because he can, nothing really happens other than you getting mad. His life doesn't really change. He gets a lot of "kibbles" - rewards from doing this - he can pretend to be whatever and feel like a big shot. Unfortunately most online stuff doesn't usually just stop at online, people usually keep pushing the envelope. But that's why I tell you to start strengthening yourself and start pulling back on listening to him and doing things for him, but let him know why. Marriage cannot be a one way proposition. I think it's important he understand WHY you are doing or not doing things and that it's a direct result of X,Y,Z he's doing. So it becomes a negotiation.
Do look into divorce and see what it looks like to you, see a lawyer, it might not be as bad as you might fear and it might be a more livable life for you. The kids will adapt, we all do. It's often better to live with one functional parent than 2 people who are not working out and one deeply unhappy parent. Don't be afraid of divorce, know what it looks like for you realistically. You don't have to do anything right away either, you can plan. But this situation IS intolerable and you have to start putting your foot down to get things for yourself. As for his behavior, you can't control it, if he refuses to change and you don't feel you can divorce right now, I'd ignore it as much as possible, and just start living your own life as much as you can. And stop rewarding him for his bad behavior. If he doesn't treat you in a loving and supportive way, he shouldn't get that back. And it should be clear to him, that this is because of HIS BEHAVIOR. I would also get an STD test (or regular ones if he continues this behavior) if you continue to have sex with him. That's up to you, not him.
The only one you can change and control is you. You can perhaps effect his behavior but you have to set up your own intentions for life and marriage. You live an authentic and honorable life even if he will not, but you have to make sure you speak your mind so he knows. Good luck and stay with us and let us know how you're doing!!!! You're not alone, many of us deal with the exact same things.