While it's hard to consider Galactus an actual villain because he is more akin to a cosmic force of nature, his former herald, the Silver Surfer, once committed a heinous crime that is much worse than anything Galactus ever accomplished, and he did it of his own volition.
Galactus is known as the Devourer of Worlds because he travels the universe in search of suitable planets to convert into the energies he needs for his sustainment. This, however, is not due to Galactus' own will. Before becoming the Devourer, Galactus was Galan, the last survivor of the sixth incarnation of the Multiverse, who was transformed by the Sentience of the Cosmos into one of the fundamental forces of the universe. Galactus' role as a «destroyer», then, is part of the natural order of the Cosmos, and he is unable to escape his ceaseless «hunger» because that is the role he has to play. Galactus is not without free will but, like the other supreme beings, he is as much a concept as a living creature. His chosen heralds, on the other hand, are mortals to whom Galactus gives part of his Power Cosmic, and they usually act based on free will, even if Galactus has been known for tampering with their minds to make them more efficient, as happened to the Silver Surfer, who had his sense of morality removed. After Surfer rebelled against his master, he reacquired his full mental capacities, and he was overwhelmed by the sense of guilt for having led his master for millennia to inhabited planets to feed upon. Many times, Surfer's past sins almost drove him crazy, but on one occasion he did something unforgivable.
Related: Galactus’ Most Powerful Creation Was NOT One of His Heralds
In Silver Surfer vol. 3 #104 (by Mike Lackey, Tom Grindberg, and Tom
Read more on screenrant.com