Butterflies don't rely only on their mouths to identify food. Some species also have taste receptors on their feet.
When a butterfly lands on a plant, these receptors can detect chemical compounds on the plant's surface. This is especially useful for females when choosing suitable plants on which to lay their eggs.
So a butterfly's feet are more than just something used for landing. They also work as sensory tools that help the butterfly determine whether a plant is suitable for its offspring.