When a guy doesn't return a hug?

so basically, the guy I am interested in(who I hangout with regularly at school) walked me to one of my classes. I wanted to give him a hug good bye, so I did. But it felt kinda awkward because when I hugged him - he didn't return it. He just kinda stood there without a reaction for like two seconds til I laughed it off and said "fine don't hug me." I noticed he had this kinda weird facial expression(like he seemed bothered or was unsure) and then he ruffled my hair and left. There were some of my classmates near us- so I'm not sure if it`s because of that. I don`t want to overthink this - but what could it mean?
When a guy doesn't return a hug?
Post Opinion