David is to Israel as Robin Hood is to Merry Olde England.
He is "one of us" in his weakness and his strength. He is not the plaster saint with painted cheeks. David is a man's man and virile scamp.
That he can be so "human" and so beloved of God endears him to readers. If David can screw up so badly and yet God LOVES HIM--there must be hope for me.
The bible accounts of David refuse to reduce the personhood of David down to the evils he committed or the worst sins he embraced. The essence of David appears to be heroic purity vis a vis his God.
Davidic lore hinges on God becoming a Jewish mother toward a naughty boy. Jehovah "tsk-tsks" at her boy's horrid antics as she punishes him. Yet, there is a soft spot in mother-Jehovah's heart and he really can do no wrong.
Whoever the real David was Israel never got another character they loved more. Jesus, where he succeeded with Jews, fit David's prototype. Where Jesus failed it was as a Davidic king and man of action.
All great Jewish leaders stand or fall in comparison to the legendary David.