A father's intense reaction to the death of his son overflows into a loud cry and a sudden physical withdrawal. In the midst of his overwhelming pain, David wraps and covers his face with a garment [מצודת ציון, ביאור שטיינזלץ].
The primary approach among commentators is that this physical covering is a direct expression of sadness and grief. It follows the traditional practice of mourners, who would wrap and cover themselves as a visible sign of their inner loss [רש״י, רד״ק, מצודת דוד].
Alternatively, this act of hiding his face may have stemmed from a deep sense of shame. Overcome by the sheer force of his feelings, David realized that such a public and intense display of emotion was not fitting for a king. He covered his face because breaking royal etiquette in such a visible, uncontrolled manner caused him embarrassment alongside his heartbreak [רלב״ג].