Worms are not in tequila bottles. They are in fact in bottles of mezcal. The hype surrounding worms in bottles was created by farmers wanting to sell more of their product. So they devised this marketing gimick to get more tourists buy bottles of tequila and mezcal.
Tequila does not have worms in the bottles. The worm, which is the larva form of the Hypopta agavis that lives in the agave plant, was placed in bottles of mezcal beginning in the 1940's as a marketing gimmick.