When you are over 50 you don't feel the urge to fight like bygone times. In Mid-life he wanted a new challenge. His cedar walled palace was commodious and peaceful. As top Monarch, he is unaccountable to anybody. The traps of Prosperity, fame, authority and too much leisure time led him into deep sin.
Hard times build strong people but easy times are dangerous times.
Unlike our sins, David's wickedness is public record. For 20 years handsome king David demonstrated noble leadership. He took Mephibosheth into his own home, he composed hymns, he ruled with fair judgement and won victories over most of his enemies, he enlarged the boarders of the kingdom to encompass 60,000 miles. His reputation was impeccable. None of us are immune to sin.