Do you think Sandor Clegane secretly despised Joffrey? Or the king`s treatment of Sansa was kind of turning point for him?
Yeah, Sandor Clegane never liked Joffrey.
“The Stark boy is nothing to me,” Joffrey said. “I cannot abide the wailing of women.” Tyrion Lannister reached up and slapped his nephew hard across the face. The boy’s cheek began to redden.
“One word,” Tyrion said, “and I will hit you again.”
“I’m going to tell Mother!” Joffrey exclaimed.
Tyrion hit him again.
- Tyrion I, AGoT
What does Sandor do about Tyrion slapping Joffrey?
“The prince will remember that, little lord,” the Hound warned him. The helm turned his laugh into a hollow rumble.
He’s exactly the sort of sworn sword you want - the sort that thinks someone slapping his charge is hilarious. He knows exactly what sort of person Joffrey is, and so he can advise Sansa about Joffrey’s desires.
Ser Meryn and Ser Arys followed him out, but Sandor Clegane lingered long enough to yank her roughly to her feet. “Save yourself some pain, girl, and give him what he wants.”
“What… what does he want? Please, tell me.”
“He wants you to smile and smell sweet and be his lady love,” the Hound rasped. “He wants to hear you recite all your pretty little words the way the septa taught you. He wants you to love him… and fear him.”
- Sansa VI, AGoT
But note the “save yourself some pain” aspect of his advice. This is good advice in the situation, but it’s not the only thing that someone can do. Sansa refuses to only preserve herself and save herself some pain, but risks herself to stick up for Ser Dontos, Tommen, and the unnamed beggar woman during the bread riots.
Watching her, Sandor starts to see that defying evil is possible and that not everyone is awful. If not everyone is awful, that means that Joffrey’s service isn’t the only option. Her courage gives him courage - ultimately, the courage to leave.