Eck and Hoffmann were executed because in their roles as the boat's senior officers, responsibility for the actions of their crew, as well as their own, fell directly on their shoulders.
Eck and Hoffmann faced execution because of their roles as the boat's top-ranking officers, where they held complete responsibility for their subordinates' activities and their own conduct.