Old English gylt "crime, sin, moral defect, failure of duty," of unknown origin, though some suspect a connection to Old English gieldan "to pay for, debt," but OED editors find this "inadmissible phonologically." The -u- is an unetymological insertion. In law, "That state of a moral agent which results from his commission of a crime or an offense wilfully or by consent" [Century Dictionary], from early 14c. Then use for "sense of guilt," considered erroneous by purists, is first recorded 1680s. Guilt by association recorded by 1919.