It's not just the OP's son who could have handled this better; I put some of the responsibility on the teachers, who are the adults in charge.
I've been thinking along these same lines.
It's one thing to just tell students that it's important to show respect for less-than-textbook clients and to treat them with dignity, and even to describe in words what some of the problems might be and how to deal with them.
But it's quite another to see it for the first time, with no warning, and just be expected to sink or swim.
Yes, yes, yes, it's very important that the OP's son learn to deal with clients of all levels of health and hygiene and to always behave professionally. But it doesn't sound like he was very well prepared to do so, and panicked and did the best he could, which was, granted, not the best that could have been done, but the best he could do under the circumstances.
Honestly, and I realize that the OP's son has no actual power to make this happen, I think that if this particular school gets a lot of homeless or very poor clients, it could be a great opportunity for both students and clients to have special times for only those clients, at maybe even more discounted rates, to give the clients more dignity and self respect by allowing them to keep their hair cleaner (and not get to that point where it is that extreme to deal with) and to provide the students the opportunity to take more time to interact with those clients, and not rush, and learn to handle that situation with respect and grace and dignity.
Bottom line is, I think some learning opportunites are going to waste here, and that the OP's son handled it in a way that was not ideal but really really understandable. For a fully trained professional, it would not have been understandable, but the very point here is that he was not. He was still in school and relying heavily on his teachers in difficult situations, as was appropriate.