In early English, a stock was a tree trunk, and by the fourteenth century it figuratively meant the family tree or the consequences of breeding.
For example, someone might be from “farming stock” or “good stock,” while an animal’s breeding line was traced through their “livestock.”
If someone calls you a laughingstock, they are insulting your family tree as being one filled with fools from which you are the current crop.
The word laughingstock is also often used for someone who commits a foolish error.