2 Chronicles - Chapter 25

"Amaziah was twenty-five years old when he became king, and he reigned twenty-nine years in Jerusalem. His mother’s name was Jehoaddan of Jerusalem. And he did what was right in the sight of the Lord, but not with a loyal heart."

Here, King Amaziah was doing the right things, but his heart was not right.  The word translated here as "loyal" means perfect, whole or complete. God is looking for people giving him their whole heart.  The attitude of a persons heart is more important than their actions.

Jesus emphasises this point in Matthew 22:

"Then one of them, a lawyer, asked Him a question, testing Him, and saying, “Teacher, which is the great commandment in the law?” Jesus said to him, “‘You shall love the Lord your God with all your heart, with all your soul, and with all your mind.’ This is the first and great commandment.""