Accidentally swallowing or breathing in pinworm eggs causes a pinworm infection. The microscopic eggs can be carried to your mouth by contaminated food, drink or your fingers. Once swallowed, the eggs hatch in the intestines and mature into adult worms within a few weeks.ccidentally swallowing or breathing in pinworm eggs causes a pinworm infection. The microscopic eggs can be carried to your mouth by contaminated food, drink or your fingers. Once swallowed, the eggs hatch in the intestines and mature into adult worms within a few weeks.