It's not 'no good deed goes unpunished' but 'even minor characters are people.'
The Red Wedding works because we know Robb and Catelyn are the IMPORTANT character while Walder Frey is a minor character. Robb breaking a pact with Walder might have consequences, but Walder's not a viewpoint character and hasn't had much build up.
What happens is like an episode of Star Trek where the villain of the week kills Captain Picard. For reals.
Likewise, we know that Daenerys and Khal Drogo are IMPORTANT characters, so when Daenerys rescues a random woman from being raped, we expect gratitude. After all, it's clear to us (through Daenerys' viewpoint) that Daenerys is a kind, wonderful lady while Drogo is an awesome, handsome lord.
Of course, the random woman doesn't see it that way. She sees them as mass murdering rapists who butchered her family and then expected gratitude -- which is exactly what they are. So she kills their leader and his son.
We see the exact same thing happen with Jon Snow later on.