On the surface they appear to be contradictory but the gist of the sermon was that it’s about context and where your heart lies.
If you do good because you’re virtue signalling and making it all about you then that’s a wrong motive.
However, by being open you can actually encourage others to make a difference.
Good works, shared with a pure heart, can actually inspire others to do the same.
Acts of kindness and generosity can become contagious.