U.S. slang; said in "Dictionary of American Slang" to be originally 1920s army and 1930s college student slang for "venereal disease." Thus by 1940, "dirty, disreputable person," and by 1950, "undesirable impurity." By 1945 (with various modifiers) it was the G.I.'s name for disease of any and every sort."
Perhaps this word is a continuation of crud as the old metathesis variant of curd (q.v.), which would make it an unconscious return to the original Middle English form of that word. Century Dictionary (1897) has crud only in the sense "Obsolete or dialectal form of curd."