"But the Lord said unto Samuel, Look not on his countenance, or on the height of his stature; because I have refused him: for the Lord seeth not as man seeth; for man looketh on the outward appearance, but the Lord looketh on the heart." - 1 Samuel 16:7
Heavenly Father does not look only at the exterior of a person, or even the things a person does, and judge the individual by that criterion. Man judges after the flesh, but Heavenly Father judges by the heart.
It is possible to do good works and still have a wrong heart attitude. It is also possible to do some things wrong but still have a right heart on the inside. Heavenly Father is much more inclined to use a person with a good heart and a few problems than He is to use a person who seems to have it all together but who has a wicked heart.
It is very important that we get in touch with our inner life and our heart attitude, the way we fell and think about things, whe the Old Testament calls the hidden man of the heart, if we want to have any success as a Christian.
"When Heavenly Father seeks to promote He chooses a person after His own heart."