There are many species of Bagworm Moths, in the Psychidae family of Lepidoptera.
A Bagworm Moth caterpillar hatches, begins eating, and making it’s “bag” as it grows. It sticks out its head and thorax (legs are on the thorax) from the bag to move about.
When the caterpillar is ready to pupate, it pupates in the bag. Males emerge and fly to find females and mate. The male locates the female by scent. She stays inside the bag, inside her pupa shell, and the male mates with her through the opening in the bag. She lays eggs in the pupal case.
Patty Britt took a video of a bagworm crawling, the caterpillar clearly visible as it moved along. You can see her video by clicking here.