I don’t agree with @AstroChuck about the “spreading your seed” thing. Studies have found that the need to procreate is not an excuse for committing adultery. Furthermore, there are just as many women who cheat as their are men. It’s just more widely acknowledged in men for whatever reason.
I’ve never cheated personally, but I know someone who has. She has has a lot of bad experiences in relationships which has kind of messed her up relationship-wise. She has this habit of “overlapping” relationships – cheating on her current boyfriend, breaking up, and immediately start dating the person she cheated with.
I think for her (and many others) it is a matter of insecurity. She gets so involved with the relationship that she doesn’t know how to get out, even when she feels it’s not going well. Cheating is an easy way to get out of a relationships, because the boyfriend usually breaks up with her because of it. There’s also the benefit of having a new boyfriend ready and willing to take the old one’s place.
For men, I believe it’s a similar situation. Men who have fulfilling relationships are less likely to cheat; cheating happens because there is some element of their relationship that is not working out, and cheating is a way to make up for that.
Relationships between people are always complicated, and that’s just a fact we have to accept.