Pinworm is highly contagious and spreads through the ingestion of pinworm eggs. These eggs can be transferred via contaminated hands, surfaces, or objects. Children often get infected by touching their mouths after scratching their anal area or after coming into contact with contaminated surfaces, such as toys, bedding, or clothing.