Commentators explain that by forcing Joab, the murderer, to tear his clothes and wear sackcloth, David was issuing a public rebuke. This wasn't just mourning; it was a form of public penance, designed to show the entire nation that David condemned the treacherous act and was not complicit in it.