In the good ole days all Captains were court martialled over the loss of their ship for any reason, even if they were not at fault and were honourably acquitted
One reason, I suspect, was that it was a formal way of establishing what had happened
I don't know when this practice stopped - perhaps it still happened in WW2