Now set your heart and your soul to seek after Yahweh your God; arise therefore, and build the sanctuary of Yahweh God, to bring the ark of the covenant of Yahweh, and the holy vessels of God, into the house that is to be built to the name of Yahweh.
Now David had his admirable points, but David also had his weak points. And David, for the most part, was a poor father. And as the result of the fact that he was a poor father, he had problems with his children. Now Solomon, in observing this and later writing the Proverbs, had many things to say about correcting children. That's one thing that David was very lax in, that was the correction of his sons.