It stops the hook from opening (and the winchman falling off the hook) if the hook gets knocked as the winchman leaves the aircraft. He removes the pin once clear of the aircraft so he can quickly release himself from the hook when he lands on the boat.
Best wishes
SiClick