The less gratitude you receive for doing a kind act, the greater the value of the act. True kindness is when we do not receive anything in return for what we do.
Instead of feeling resentment towards the person who is ungrateful, take pleasure in doing a more elevated good deed. Focus on how your kindness towards that person is more altruistic.
Don’t tell yourself, “How awful it is that I’m doing all this kindness and this person is not doing me favors in return.” Rather, tell yourself, “This is a great opportunity to do a true act of kindness!”
Sources: see Genesis 47:29 with Rashi; Rabbi Zelig Pliskin’s “Gateway to Happiness,” p.106