They just use whatever organic matter in their immediate surroundings. So if there are sticks, they’ll build a cabin😆
Also, only male bagworms become moths. Females stay as a bagworm and never leave their bag/case.
More Bagworm Moth Caterpillar Facts here!
https://a-z-animals.com/animals/bagworm-moth-caterpillar/
Caddisfly larvae also do this, although they are aquatic. In fact you can identify caddisfly species based on the casings the larvae build.