c. 1300, roten, of animal substances, "in a state of decomposition or putrefaction," from a Scandinavian source akin to Old Norse rotinn "decayed," past participle of verb related to rotna "to decay," from Proto-Germanic stem *rut- (see rot (v.)).
Of vegetable substances from late 14c. Also used in North America of weak, melting ice (1660s). The figurative sense of "morally corrupt, wicked; unsound in character or quality" is from late 14c.; the weakened slang sense of "bad" is recorded by 1880.
Rotten apple is from a saying traced back to at least 1528: "For one rotten apple lytell and lytell putrifieth an whole heape." The Rotten Row in London and elsewhere probably is from a different word, but one of uncertain origin. Rotten-hearted is attested by late 14c.