Why would a plant evolve to produce an addictive chemical?
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