1801, "spectre, apparition, ghost," from Dutch spook, from Middle Dutch spooc "spook, ghost," from a common Germanic source (German Spuk "ghost, apparition," Middle Low German spok "spook," Swedish spok "scarecrow," Norwegian spjok "ghost, specter," Danish spøg "joke"), of unknown origin. According to Klein's sources, possible outside connections include Lettish spigana "dragon, witch," spiganis "will o' the wisp," Lithuanian spingu, spingėti "to shine," Old Prussian spanksti "spark."
Meaning "undercover agent" is attested from 1942. The derogatory racial sense of "black person" is attested from 1940s, perhaps from notion of dark skin being difficult to see at night. Black pilots trained at Tuskegee Institute during World War II called themselves the Spookwaffe.
"one who returns," especially after a long absence; "a ghost, one who returns from the dead," 1814 (in "Rosanne" by Laetitia Matilda Hawkins), from French revenant (fem. revenante), noun use of present participle of revenir "to return" (see revenue).
Thus it shares ancestry with many dialect words for "ghost, specter," such as bog/bogge (attested 16c.-17c.), bogeyman (16c.), boggart "specter that haunts a gloomy spot" (c. 1570, in Westmoreland, Lancashire, Cheshire, and Yorkshire). The earliest modern form appears to be Scottish bogle "ghost," attested from c. 1500 and popularized c. 1800 in English literature by Scott, Burns, etc.
1630s, "a ghost, specter, disembodied spirit" (earlier as larve, c. 1600), from Latin larva (plural larvae), earlier larua "ghost, evil spirit, demon," also "mask," a word from Roman mythology, of unknown origin; de Vaan finds a possible derivation from Lar "tutelary god" (see Lares) "quite attractive semantically."
Crowded out in its original sense by the zoological use (1768) which began with Linnaeus, who applied the word to immature forms of animals that do not resemble, and thus "mask," the adult forms.
On the double sense of the Latin word, Carlo Ginzburg, among other observers of mythology and folklore, has commented on "the well-nigh universal association between masks and the spirits of the dead."