I know that. I am saying it is still a moral argument. I say that should not be the law because it obligates everyone to potentially put themselves in harm way to save another. It is not right and I do not agree with it. hence, a moral/philosophical argument.
So yes, i still think it is 100% fine to keep foreigners out of your land and whatever happens is on them. If that law is a huge deal then give them food and water THEN send their asses back.
if their ship capsizes, charter another to send their asses back.
No matter how you slice it, the argument doesn't change. Send them back. Give them nothing for trying to enter your land except a one way ticket back where they came.