booby (n.) Look up booby at Dictionary.com
"stupid person," 1590s, from Spanish bobo "stupid person," also used of various ungainly seabirds, probably from Latin balbus "stammering," from an imitative root (see barbarian).

Specific sense "dunce in a school class" is by 1825. Booby prize is by 1883: an object of little value given to the loser of a game; booby trap is 1850, originally a schoolboy prank; the more lethal sense developed during World War I.
At the end of every session the dominie had the satirical custom of presenting his tawse as a "booby-prize" to some idle or stupid lout whom he picked out as meriting this distinction so that next time they met he might start fresh and fair with new pair for a new set of classes. [Ascott R. Hope, "Dumps," "Young England" magazine, 1883]
Booby-hatch "wooden framework used to cover the after-hatch on merchant vessels" is from 1840; as "insane asylum" by 1936.