Tapeworm infection is caused by ingesting food or water that is contaminated with tapeworm eggs or larvae. Larvae are newly hatched tapeworms.