I posted this in another thread, in a supporting members-only area, and I am reposting it because it addresses your question, at least in regard to a specific religion.
Being Jewish myself, maybe I can shed some light on this for you.
There are several levels of observation of Judaic tradition; the most commonly known 3 are Reform (least observant), Conservative (middle), and Orthodox (most observant), along with outliers on either end. All Orthodox, most Conservative, and some Reform Jewish men will wear yarmulke or some other form of head covering. The religious requirement is to cover one's head out of respect for God - the type of covering is not important, and many men who wear yarmulke will wear a hat over it for one of several reasons - to keep it from falling off, to fit in better (baseball caps are common), personal preference, etc. Some, especially those from the middle east, will wear a cap resembling the ones worn by Muslims. So just wearing a yarmulke (or not) is not a clear indication of the level of a person's observance of Judaism.
First of all, Hasidism is a sect of Judaism, whose members are Orthodox (often ultra-Orthodox), but it is a belief system, and Hasids do not all necessarily wear the clothing you are referring to (black suit, white shirt with no tie, hat, etc.). The clothing style stems not from Hasidic tradition, but from a group of Hasidic Jews who lived in northern and middle Europe in the 1800s when that was the common style of dress - when styles changed (and became less modest, in their opinion) they maintained the style of dress, but it has nothing else to do with their belief system.
As far as not touching a woman who is not his wife, this is an Orthodox Jewish (rather than Hasidic) issue. Back in Biblical times, a woman who was menstruating was considered ritually (and often, literally) unclean, and anyone who touched her became likewise unclean. Rather than ask a woman if she was unclean (that is, menstruating), men avoided contact with women other than their wives, whose cycles they presumably knew. Because the contact in class is a requirement of the class, he is allowed to touch you then, the same way he would in any other activity that requires contact with the opposite gender to complete. This is actually a modernization, and is proof that he is neither Hasidic nor traditionally Orthodox - if he were either, he would be unable to touch you at all, no matter the requirements of the activity. An example of the extent of this would be that Orthodox men in cities with subways and buses will not sit down because a menstruating woman might have sat on the seat at some point. Many Jewish men who are Orthodox will avoid non-professional contact with women because of this requirement. This is why, when you see Orthodox Jews portrayed in film (Fiddler on the Roof is a prime example) they dance with their own gender, and when they do dance with the other gender, they don't touch except through a handkerchief.
The man you are referring to may be considering you a professional contact so that he can actually touch you during class, as not doing so could cause significant problems, but outside of class this interpretation is not possible, so he can't touch you. I would give him credit for telling you what was going on (although I would take some away for not explaining it more fully), and not worry about being the only woman besides his (currently non-existent) wife he is able to touch.
I hope this helps!