Johnson: And really it is wonderful, considering how much attention is necessary for men to take care of themselves, and ward off immediate evils which press upon them, it is wonderful how much they do for others. As it is said of the greatest liar, that he tells more truth than falsehood; so it may be said of the worst man, that he does more good than evil.
I'm not sold on Johnson's last proposition, though taking the meaning as "the worst man you might run into on any given day" rather than "the worst man ever" might at least bring it within poetic distance of the truth.
Both cheating and charity are generally hidden acts, so the inexperienced observer might well underestimate how much of each goes on. That the same person can be a great cheat and a cheerful giver is one of those things you don't so much explain as get used to -- or, perhaps, the explanation is simply that humans aren't particularly consistent.