Even if his intentions are pure, his actions could be taken the wrong way by a lonely, depressed teenaged girl. This was probably not the wisest course of action and could have easily backfired.
He has the right idea, but this sort of thing would be far better handled by a female teacher.
Unfortunately, same-sex is no guarantee of "pure intentions" or lack of "taking things the wrong way". The only way to do it (IMO) is to make sure all contact is observed or monitored (e.g. chaperoned by someone in a position of equal or higher responsibility). Sex of the teacher vs. student doesn't go far enough these days.