He didn't want to work with the crew because he didn't want to put them in danger, he can't think with plot armor, you're hating sanji for being a fictional character who doesn't realize luffy will always win no matter what
And he didn't leave germa for themselves, bro re-watch the arc, he didn't want them to die a death they didn't choose, he says so at the beginning of the baratie arc, no one deserves a death they didn't choose
It's not hypocrisy it's empathy, judge willingly fought big mom's fleet, he could've run away but he didn't, but during the wedding judge didn't get to choose whether or not big mom tricks him