There is a Talmudic saying from מסכת שבת that tries to establish a high standard in our interaction with people.
The Gemara says that even if we have not done anything wrong, but others are punished because of how they wronged us, we are still affected.
We are kept at a distance from מחיצתו של הקדוש ברוך הוא, from a particular level of closeness to Hashem. The very fact that a person messed up and we were the vehicle that caused it, leaves a kind of stain.
The solution to getting back in Hashem’s good graces, comes when we are able to forgive that person who treated us badly. Despite their bad behavior, we should not be happy that another person falls. There is great reward if we can reach this kind of level.