First and Second Kings covers the kings that ruled over Israel and Judah. Several of the kings were good and had a description like Asa’s
“But the high places were not removed: nevertheless Asa’s heart was perfect with the LORD all his days.”
In other words, Asa didn’t do everything right, but his heart was perfect.
In the Gospels, Jesus goes off on the Pharisees, guys who seemingly did everything right but their heart was corrupt (Luke 16:15).
Consistently the Bible points out the heart’s importance. External actions can be good or bad, but God judges the heart. Doing good is no indication that the heart is good.
Doing good does not make up for a corrupt heart. Nor does having a good heart reduce the severity of sin. The heart is what makes your stand before God. Don’t be deceived.