Yevamos 110: She'lo Kahogen

The reason we act improperly with someone who did something improper.