It’s the law and I know a few captains and they take this very seriously. They feel fully accountable for the ship and all it’s occupants.
As per Wikipedia:
“The Captain or Master of a merchant vessel is a licensed mariner in ultimate command of the vessel.[1] A Ship’s Captain, also called Shipmaster or Skipper, is responsible for its safe and efficient operation, including cargo operations, navigation, crew management and ensuring that the vessel complies with local and international laws, as well as company and flag state policies.
and furthermore
No other official authorities on board, during the navigation, are in power to override the Captain from his important office. All persons aboard, crew and passengers, conforming to the nautical and navigation laws, must remain under the command and authority of the Captain.