The creatures present two dangers to a person who attempts to pick them up. First, when solidly grasped, the worm will immediately coil about whatever grabs them and constricts. They may be at lot larger than normal earthworms, but they possess supernatural strength and durability - sufficient to crush even an armored gauntlet. But this is not the worst thing they can do.
The worms also do not perceive much difference between earth and flesh - or bone for that matter, and so can easily burrow into the unwary, oblivious to the carnage that their passage may cause. They invariably choose to burrow downwards when disturbed, which can cause tremendous injury to the victim. Should one have such a worm enter their body, their best option to reduce injury is to put the affected body part to the ground - quickly.
In addition to being immensely strong for their size, and being able to burrow through virtually anything, they are incredibly durable. They are not indestructible, but are able to survive within the earth to the depths of several miles, subject to the immense pressures, temperatures and the toxicity of both air and stone. Magic, electricity and iron-melting heat are the best means to destroy one. A blacksmith’s forge at full burn could slay one.
The worms are no more intelligent than mundane worms, so magical control over them is very limited - they cannot understand instructions, no matter how simply put. The best that magic can do is to fool them, perhaps altering their perception of down
Now what, pray tell, use do these super-worms have?
The worms are strongly aligned to elemental earth, and are a repository Earth Energy. Some believe they are a type of lesser Earth Elemental. They are used as a focus in some powerful earth related spells, components in potions and in rituals creating magic items. More mundanely, they can be used to damage stoneworks and as very specialized tools for working with immensely strong materials, though control will always be a problem. Even more mundanely, they can be used as tools for murder and torture.
Immortal Worms can be found near powerful Earth energy sources, and occasionally in the earth where ley lines pass. They sometimes come into being during massive earthquakes, quickly scattering into the earth.
Earth, stone, metal and all such materials are no barrier to the worm, so typically magic is used to contain them, though there has been some success in using the skins of dead Immortal Worms as well, for they cannot breach another Worm’s flesh. Moving air and water could be used to contain them as well, if some clever means were to be designed.
Telekinesis is by far the best means of manipulating and transporting these creatures.
The worms would a worthy object for gathering by the PCs - either for a ritual of their own or in the service of some patron. The difficulty of finding and transporting the worms - especially with some opposition thrown in - could make a decent expedition.
Like a lawn after a rainstorm, a town is plagued by hundreds of these that have emerged from the earth, driven from their normal homes by some unknown force. The town now has to deal with these things randomly burrowing through their walls and other stoneworks as they go anywhere but down. For some reason, they do not travel too far from their original holes, so it seems they just can’t wait for the worms to disperse. Someone needs to either dispose of the worms, or what’s disturbed them.