What are you referring to? Is it because he wants to save his family?
Well Sanji seemed to in this arc forget
1- luffy is going to come after him
2- beating up luffy won't stop him from comming after him
3- zeff already made it clear (with luffy actually saying the words) don't throw away your life for me, I made that scrafice for you
4- luffy would protect zeff
5- luffy wants to take down all the emperors, law is with them just for that.
6- BM is an enemy who luffy authorized Sanji to attack specifically because she is an enemy
Put all that together, and you are seriously wondering why Sanji left his captain with no plan to face an emperor alone.
If Sanji had of remembered just one of those above points instead of luffy getting a note from Sanji on zou, zou arc would of looked like this
Luffy "what happened here it looks like a war zone"
Sanji "oh luffy you are finally here, hey listen I really need your help to defeat BM she is holding my family hostage, you said you would protect a kraken's family so I am sure you will help protect mine"
Luffy "hey law change of plans"
Law "I hate bread"