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".