Sanji's decision would've been way worse in result if Luffy wasn't MC.
Obviously, Luffy didn't see this as a betrayal but from the story perspective, Sanji did betray him in fact.
Once Sanji and Pudding's marriage would be sealed it is a clear example of betrayal because he married himself to the Yonko family.