As a former teacher it is indeed hard to fall into that mistake of preferring one student over the other, it gives you bias , it puts the students/professor dynamics into unbalance. He is trying to help him without giving in into his disorder, into his weaknesses because he will cling to them who knows until when. That's why he felt he made a mistake because he had the resolve to stop giving in and yet he hugged him.
Again this is just my perspective on the matter, it truly doesn't feel like an Ethics class to me but more a Philosophy class. What the other teacher said of not being therapists is bullshit that has been said by too many on the education department and that's why we deal with societal problems due to bad teachers/professors , kids see their teachers sometimes more than their parents and relatives, they must do the work to help a child/teenager the most he/she can , at least in my country when you are studying to be an educator you need to have a certain level of psychology training in order to address and help correct this issues, more important to identify them. But well that's why teaching isn't for everyone and that's why is one of the most important jobs out there , it isn't just relaying information, is forming future citizens, workers, friends, partners, lovers, bosses, judges etc , of course all limited to the premises of a school, kindergarten, university.