mid-15c., of wine, "muddy, not clear," from Middle French impur (13c.), from Latin impurus "not pure, unclean, filthy, foul," from assimilated form of in- "not, opposite of" (see in- (1)) + purus "pure" (see pure).
In English, the subsequent order of sense appearance seems to be "earthly, mundane, not spiritual" (c. 1500); "obscene, lewd, unchaste, immoral" (1530s); "mixed with offensive matter, tainted" (1590s); "mixed or combined with other things" (without reference to foulness), 1620s. As a noun from 1784. Related: Impurely.