It can be a form of communication to the other man. Remember the OP said that he had never met this man before. THINK about a situation where a man feels comfortable enough with another man’s wife to hug her right in front of him without even the courtesy of introducing himself. I am telling you that doing this is a boundary violation and if some woman came up and hugged my husband and he returned the hug without introducing me, I would feel very uncomfortable and I would get the unspoken message, “There is something between them, even a close friendship, that I am not included in.”
You guys can make fun of me all you want, but this behavior right in front of her husband is not right. There are social boundaries and this man has violated one. Even IF the OP’s wife has allowed this man to hug her at swim meets, he should not have done so in front of her husband. To have him be so familiar with her that he hugs her un-selfconsciously in front of her husband is, to me, cause for concern.