Leggatt killed the other sailor because he refused to obey orders during a storm and was endangering the vessel.
Leggatt is a man who the narrator (who is the captain of the vessel) finds swimming alongside his ship in the dark of night. He takes him on board and hears his story. Leggatt was the first mate on another ship and trying to reef the foresail so that the pressure would be removed from the sheet. He needed the sailor to obey him and help; the man refused. It's unclear exactly why he refused but Leggatt suggests that he was "half crazed with funk."
Leggatt physically reprimands him and ends up with his hands around the man's throat. Even when an awful wave comes onto the ship and the other people on it can't see anything, he keeps his hands around the man's throat. He says they had to pull them apart and that the sailor's face was black when they did.
From Leggatt's story, it seems he blacked out to some extent or blocked out what happened. He says he only came back to himself when he heard the gale winds and a voice telling him that he was a murderer.