Body language like that, says that he is more or less "Into you". I would say he has some affections obviously, and you upset him by leaving his class because from what you said, sounds like he wanted you there so he could see you, and physical contact like that is more sensual than casual. I have had good professional relations with my professors, coworkers, trainers, other professionals, and we either shook hands, or gave a very loose, casual, friendly but not so tight hug when parting. So you need to consider that that body language is more than friendly, and how you feel about it determines a lot. So ask yourself that question because no man that didn't want me, ever held me like that, but the ones that did want me, that I wanted in return, have held me in that manner. My boyfriend could tell you right now, the very same thing. Hope this helps you out because I think someone, wants a little more than a professional relationship, but you also need to be careful with that as well.
“I was never really insane except upon occasions when my heart was touched.” ― Edgar Allan Poe
Wish for a pile of shit to turn into gold hard enough and guess what? It's still a heaping pile of shit.