a broad-meaning word used of things that move slowly or with difficulty, "of obscure etymology" [OED]. From 1620s as "handle of a pitcher," this sense probably from Scottish lugge "earflap of a cap; ear" (late 15c. and according to OED still the common word for "ear" in 19c. Scotland), which is probably from Scandinavian (compare Swedish lugg "forelock," Norwegian lugg "tuft of hair") and influenced by the verb. The connecting notion is "something that can be gripped and pulled."
Applied 19c. to mechanical objects that can be grabbed or gripped. Meaning "stupid fellow" is from 1924; that of "lout, sponger" is 1931, American English. Compare lug-nut (1869), nut closed at one end as a cap.
old style of wrench with a jaw adjustable by a screw mechanism on the handle, 1841, from monkey (n.) + wrench (n.). Monkey was used in 19c. especially by sailors, as a modifier for various types of small equipment made for specific work (monkey-block, monkey-boat, monkey-spar, etc.), and the same notion probably is behind the name of the tool. The figurative sense of "something that obstructs operations" is from the notion of one getting jammed in the gears of machinery (compare English spanner in the works).