As my devotional bible points out, it is absolutely heartrending for a parent to watch helplessly as their child destroys their life by sin. But different commentaries have different thoughts regarding David's response to Absalom's death.
Matthew Henry's concise commentary: Some think David's wish arose from concern about Absalom's everlasting state; but he rather seems to have spoken without due thought. He is to be blamed for showing so great fondness for a graceless son. Also for quarrelling with Divine justice. And for opposing the justice of the nation, which, as king, he had to administer, and which ought to be preferred before natural affection. The best men are not always in a good frame; we are apt to over-grieve for what we over-loved. But while we learn from this example to watch and pray against sinful indulgence, or neglect of our children, may we not, in David, perceive a shadow of the Saviour's love, who wept over, prayed for, and even suffered death for mankind, though vile rebels and enemies.
My Life Application Bible: Why was David so upset over the death of his rebel son? (1) David realized that he, in part, was responsible for Absalom's death. Nathan, the prophet, had said that because David had killed Uriah, his own sons would rebel against him. (2) David was angry at Joab and his officers for killing Absalom against his wishes. (3) David truly loved his son, even though Absalom did nothing to deserve his love. It would have been kinder and more loving to deal with Absalom and his runaway ego when he was younger.
MacArthur Study Bible: In spite of all the harm that Absalom had caused, David was preoccupied with his personal loss in a melancholy way that seems to be consistent with his weakness as a father. It was an unwarranted zeal for such a worthless son, and a warning about the pitiful results of sin.
From enduringword.com: We can understand David’s strong reaction by understanding that in part, David was so because he knew that he supplied the soil this tragedy grew from.
Tomorrow's Bible In a Year Passage: 2 Samuel 19:11-20:13, John 21:1-25, Psalm 120:1-7, Proverbs 16:16-17