Although David was "mere man" and "fell short" several times, God said in Acts 13:22 "...I have found David, the son of Jesse, A MAN AFTER MINE OWN HEART, who shall fulfill MY WILL."
You see believers, God DOES NOT "look" at us as "mere man" does! He looks at the "HEART!" (I Samuel 16:7)
When chosen by God, one may look like a "jackass" (Numbers 22:28) to "mere man," but if chosen (after "seeing" one's heart) by God for HIS WILL, one is a "good man" in the sight of the Lord!
Did David not "suffer" for his sins? So shall we but with confession and repentance by "His Grace," we shall be saved!