1 Kings 15:14
14 But the high places were not removed: nevertheless Asa’s heart was perfect with the LORD all his days.
KJV
It would be a mistake to assume that a perfect heart amounts to a sinless life resulting in wholly perfect actions even as our Lord. Consider King David. Although he committed adultery with Bathsheba, plotted the killing of her husband, disobeyed God by numbering his forces and had countless difficulties when rearing his children, scripture describes him as a man “after God’s own heart.” And no less was the case with his great-great grandson Asa. Asa, who began his reign with a series of reforms and great victories, concluded his life with a refusal to seek God’s assistance for his own health or in battle. Yet, in spite of this, scripture records that his “heart was perfect with the LORD all his days.” The notion of a perfect heart speaks to those motives that fuel actions. While one may indeed accomplish wonderful things for God, God will only be concerned with the motives by which these things were accomplished. On the other hand, one may fail to accomplish something that brings glory to God, but God will be principally concerned with what were the motives of the heart:
[For the eyes of the LORD run to and fro throughout the whole earth, to shew himself strong in the behalf of them whose heart is perfect toward him.] KJV 2 Chronicles 16:9