A military victory is typically a time for public celebration and pride. Yet, in the aftermath of this battle, the returning soldiers experience a harsh atmosphere of shame and defeat rather than triumph.
The victorious fighters do not march into their home city with the joy and pride expected of a winning army. Instead, they slip in secretly and quietly, behaving more like thieves. Their arrival closely resembles the behavior of a defeated army fleeing the battlefield in total disgrace [מצודת דוד, ביאור שטיינזלץ].
This highly unusual atmosphere among the troops is compounded by the king's reaction. Rather than greeting his victorious men, the king hides his face like a mourner and cries out loudly in grief. Seeing the army sneaking into the city and the king completely consumed by his sadness prompts Joab to intervene. As someone deeply and personally involved in the events, Joab feels compelled to step forward and firmly rebuke David for his actions [מלבי״ם].