The sailor was punished by being married to the gunner's daughter.
gunner's daughter
idiomThe gun to which sailors were tied to be flogged.
Discipline on the old ship was harsh, and many men feared the punishment known as the gunner's daughter.
In the brutal days of the navy, a sailor who broke the rules often found himself tied to the gunner's daughter to receive his lashes.