King Hanun suspected David's servants of being spies, so he shaved off half the beard of each and cut off their garments in the middle, at their hips. (2 Samuel 10:4) They were greatly ashamed, so David met them himself and told them to remain at Jericho until their beards regrew then return. (2 Samuel 10:5)
The Jews wore their beards long, reckoning it an honour to appear aged and grave; and therefore it was not fit that persons of their rank and figure should appear at court unlike their neighbours.
(Blue Letter Bible - Matthew Henry Commentary - https://www.blueletterbible.org/Comm/mhc/2Sa/2Sa_010.cfm)