Shem was not just doing the right thing, he did it based not on his desires. Very much unlike his brother, Cham.