How many generals do you think haven't had affairs at some point in their career? Even General Dwight Eisenhower had a mistress during World War II. I mean, let's face it: they're away from home a lot, their wives usually aren't very exciting (compared to blowing people up, that is), and there are probably plenty of women with "Doing a general" on their Bucket Lists.
Petraeus? Well, first of all, he could have done much better (and maybe he did), and second, I wish he would have instead been spending his spare time figuring a way to get us out of Afghanistan faster.