It seems kind of anti-productive in terms of survival for a plant to produce an addictive chemical as that plant will constantly be sought after by animals that ingest it. In this instance, I'm looking for a possible general & inclusive answer here that would describe most plants that make this. Not a specific instance (although if provided as an example would be a plus).

To appreciate the scope of this is terms of number of plants producing potentially addictive compounds - see this compendium:

compendium of botanicals reported to produce toxic, physchoactive or addictive compounds

It's a matter of perspective. Most of the chemicals that are addictive to us humans (particularly alkaloids), and may be addictive for some other animals as well, are also insecticides. Lots of plants that we consider poisonous are good food for other species, and lots of plants that insects would consider poisonous are treats for us.

This is a great example of the aimless nature of evolution. The plants that could successfully defend themselves against insects stabilize on a solution that happens to be bad for them in certain ways. Although, you would be hard pressed to find a better way to guarantee reproduction than being addictive to humans.

Background reference


Plant-insect coevolution and inhibition of acetylcholinesterase
The defensive role of alkaloids in insects and plants
Exploration of nature's chemodiversity: the role of secondary metabolites as leads in drug development


Also of interest


Bees prefer foods containing neonicotinoid pesticides

