I think the quote is a translation of one of the teachings within what is known as 'the greatest commandment: Love'.
"The greatest commandment tells us that love should motivate everything we do. And yet we fall short in our motives. Sometimes we do right for the wrong reason. Perhaps we are afraid of what others think. We want others to think well of us, so we do right, but our motive is essentially self-centered."
This is the kind of wisdom that spans all religions and secular beliefs and non-beliefs. why? because it's wise, reguardless of who said it.