2 And for the whole army the victory that day was turned into mourning, because on that day the troops heard it said, “The king is grieving for his son.”

Read 2 Samuel 19:2 Using Other Translations

And the victory that day was turned into mourning unto all the people: for the people heard say that day how the king was grieved for his son.
So the victory that day was turned into mourning for all the people, for the people heard that day, "The king is grieving for his son."
As all the people heard of the king’s deep grief for his son, the joy of that day’s victory was turned into deep sadness.