A “fly in the ointment” is a minor flaw or irritation that spoils the success or enjoyment of something, especially one that wasn’t at first apparent.
Example: “We had a cookstove, beans, and plates; the fly in the ointment was the lack of a can opener.” In my opinion, that was more than a fly; that was a great bumbling wasp!
There can be an implication that something unpleasant may come to light in a proposition or condition that is almost too pleasing; that there is something wrong hidden, unexpected somewhere. In other words, “This is too perfect. There has to be a catch somewhere!”
In early times, ointments were likely to be creams or oils used as cosmetics or for ceremonial purposes. In literal terms, ointment was the substance one was anointed with. The Bible often mentions someone being anointed, and it isn’t surprising that this phrase has a biblical origin. Ecclesiastes 10:1 (King James Version) says, “Dead flies cause the ointment of the apothecary to send forth a stinking savor: so doth a little folly him that is in reputation for wisdom and honor.”
The first use of the idiom “a fly in the ointment” didn’t appear in the English language until early in the 1700s, in the book A Practical Treatise Concerning Humility by John Norris.
Apparently, no one has been concerned about how the fly felt about being trapped in a pot of goo.