Why would my boyfriend get mad at this?

So this guy (who is cool with everyone including my boyfriend) was giving everyone hugs. My boyfriend was on his phone so I didn’t think he was paying attention. So when they guy gets to me my boyfriend gets off his phone and is looking at us. I hug the guy just a little. After my boyfriend just gets angry.
Why would my boyfriend get mad at this?
Post Opinion