A booby prize is a joke prize usually given in recognition of a terrible performance or last-place finish. A person who finishes last, for example, may get a booby prize such as a worthless coin. Booby prizes are sometimes humorously and jokingly coveted as an object of pride.
The word "boob" stems from the Spanish bobo meaning stupid, which in turn came from the Latin balbus meaning stammering; the word booby to mean dunce appeared in 1599.
Booby prize literally means "idiot's prize". The OED dates this usage to 1893. Booby trap and "booby hatch" are related terms.