1) What are you talking to me about? Luffy didn't even know what an alliance was, and is still being silly asking law if he was going to betray him.
2) It's not a development, Luffy has always been like this from the start (Nami, Robin, ...)
3) Luffy has always wanted to protect his friends even if it means keeping them away from the enemy, it's not the first time he's done it
4) This is to be the only time Oda really showed a development of his main character, otherwise it's still the same and even like that 30 chapters later he becomes stupid and "screw up" the infiltration
In the same raid, even after he was defeated by Kaido, Luffy relayed message to samurai not to stop the fight...and even SH knew that he was going to be fine....
At the end of the day, Luffy goofs up most of the time as long as he is with his crew or with someone he can absolutely trust and rely on his crew for many things....but only becomes serious when it is in utmost need....