If a ship is sinking, maritime tradition dictates that the captain ensures the safe evacuation of every passenger before he evacuates himself. He (or she) is responsible for the lives of those onboard, and he can’t coordinate their exit unless he’s the last person off. In certain countries, like South Korea, some version of this has been codified into law, which is why the captain of the Sewol, Lee Jun-seok, faces criminal charges. He escaped while scores drowned. But maritime law varies by jurisdiction, so there is no universal legal standard for how a captain ought to behave when his ship is sinking. All we have is the maxim, which seems fair provided you don’t take it too literally — which I think you have.
The captain is not obligated to drown on principle. There are, certainly, examples where a captain has elected to remain on a boat while it sank into the sea (E. J. Smith, captain of the Titanic, is perhaps the individual best known for doing so). This, however, is not a reasonable job expectation. The value of a ship itself is not greater than the value of the person controlling it. Even if the captain’s own negligence results in hundreds of deaths, it’s not his symbolic duty to add his life to the total. If he’s no longer in a position to save anyone else, he can absolutely save himself.