After doing something good (like making a donation or eating healthy) people can justify to themselves that they can then do something not so good (like lie, cheat or eat junk food). Justifying doing something bad after the good is known as moral licensing or self-licensing.
Examples:
A person ate a very healthy lunch but then they go to an office party with lots of snacks. They overeat snacks, telling themselves that they can have that extra cupcake (or two) because they had a healthy lunch.
A nurse spent extra time with their first patient that morning. It’s now afternoon and they want a break, so they rush through afternoon rounds and don’t take all of the measurements accurately.