I think this may be an "Americanism" - I've seen it on JudgeJudy alot anyway.
But am puzzled too. It means, basically, that if you do something good or nice, someone will always throw it back in your face and make life hard for you as a consequence! The kind of opposite of "virtue is its own reward".
Is this a very cynical expression? Or sadly accurate?