There is evidence that worms do feel something akin to pain.Worms have been found to possess opioids, which would serve no real function in the absence of pain perception:
In worms, sperm sacs serve as the storage site for sperm produced by the male reproductive system. These sacs store the sperm until it is transferred to the female during mating, allowing for efficient fertilization of eggs.
To serve a ritual function.
to eat worms
How does cholesterol function
By the Function they serve
Egagt
The function of seeds are for the plant to reproduce.
they serve as controllers
the head
By the Function they serve
Irrigation system