Butterflies gather on wet areas to extract minerals from the mud, much like they collect nectar from a flower. This is appropriately called “puddling”. The minerals, such as salt, are important to a butterfly’s health, playing an essential role in the reproductive process. They may also help the butterfly control its body temperature. Male butterflies appear more likely to engage in this behavior—they apparently need the supplemental minerals more than females.
Text via: Birds & Blooms