Hello and Thank You for using Just Answer. Children at the age of 3 often imitate what they see and hear. The 3 year old is probably showered with affection by his mother since she is so affectionate anyway. Therefore, the three year old was probably so elated to spend time with other children during a camping trip that he simply felt the need to hug them as well. If the hugging becomes troublesome or a worry, the three year old needs to be told that he can give one "hello" hug and one "goodbye" hug when he meets people.
Have an awesome day!!!