Whole Cake Island was a very important arc for One Piece fans, since it tested the true companionship between Luffy and Sanji.
Friendship is a major theme in the One Piece series. When Sanji was forced into an arranged marriage, Luffy and company went to Whole Cake Island just to rescue him. Unfortunately, once they caught up to him, Sanji didn't want to come back to the Straw Hat Pirates. He even beat up Luffy to prove his point.
This particular moment was uncharacteristic for someone like Sanji. He is among the nicest characters in the One Piece series. However, his "betrayal" wasn't for his sake, but rather his entire crew. Sanji felt that he had no choice in the matter, since they would be in grave danger otherwise.
Why did Sanji "betray" Luffy in the One Piece series? Here is a simple explanation
Everything Sanji did in Whole Cake Island was to protect his friends. Luffy already knew that he would never willingly leave his pirate crew. There had to be a reason why Sanji acted the way he did.
Sanji didn't want Big Mom to go after the Straw Hats
During the Zou arc, Sanji was given an invitation to Big Mom's tea party. It turns out that his family used him as a pawn for a marriage proposal. They wanted to marry into the Charlotte family to obtain more power.
Despite cutting ties with his abusive family a long time ago, Sanji was backed into a corner here. Vito from the Fire Tank Pirates explained his situation very carefully:
"As they say, even the demons of hell dutifully attend our Mama's tea parties!"
Remember, Big Mom is among the elite fighters in the One Piece series. With a grand fleet of powerful warriors, she commands great respect from her peers. At this point in the One Piece story, the Straw Hats wouldn't stand a chance against her. Big Mom was not someone they could take on lightly.
Sanji already knew this, which is why he agreed to his forced marriage with Pudding. Big Mom promised to leave the Straw Hats alone if he went through with it. When he ran into them right before the wedding, Sanji viciously attacked Luffy just to make him go away.
It's among the more heartbreaking scenes in One Piece history. Luffy doesn't bother fighting back, since he knew that Sanji was forced into this position. Nami even slaps the taste out of Sanji's mouth, angered by his betrayal.
Of course, he only did what he did because he didn't want Big Mom to hurt his friends (or worse). She had a tendency of sending a message to anybody who went against her. Sanji feared that she would go after the Straw Hats, his family, or even Zeff back in the Baratie.
Of course, Luffy doesn't give up on his nakama
No matter how difficult a situation may be, Luffy always tries to save his friends. The Straw Hat stayed behind the island just so he could bring back his friend. He even starved himself just so Sanji could feed him.
During that particular meeting, Sanji breaks down and tells Luffy the truth. He only stayed in Whole Cake Island so he could try to protect everybody. The Straw Hat welcomes him back into the crew, with the intent of crashing the wedding.
Note: This article reflects the writer's personal views.