The condition, direction and focus of our hearts determines our actions - both good and evil actions.
Speaking of King Rehoboam, 2 Chronicles 12:14 says, "He did evil because he had not set his heart on seeking the Lord."
Everything Rehoboam DID was because of the CONDITION, DIRECTION and FOCUS of his heart. And, what you and I do today is because of the condition, direction and focus of our hearts.
God told David that he "did well to have it in your heart to build a temple for my name." God was pleased with David's desire, even though David never built that temple. (2CHR6:8) God judged the intention of his heart.