The "sperm" is spermaceti, a hard white oily substance taken from the head of a sperm whale. During the 18th and 19th centuries, oils from a range of whales were used to fuel lamps and make candle wax. About three tons of oil could be obtained from the head of a single sperm whale. Spermaceti was extracted from the oil via an industrial process.
The use of whale oil in lighting began to decline in the second half of the 19th century as kerosene from coal, and then petroleum products, became available.
Curiously, spermaceti candles inspired an architectural style of cast-iron columns in New York: "sperm-candle style".