Thanos wasn't trying to stop starvation. He was secretly delaying the Emergence. Y'all forget that Thanos isn't just some random warlord. he's an Eternal from Titan, the brother of Eros, and he knew the exact secret the Celestials tried to hide. Every intelligent planet in the universe is just an incubator for a newborn Celestial sleeping inside its core.
How does a Celestial hatch? Not from time ,from population. A planet has to reach a massive threshold of sentient life energy before the Celestial wakes up and cracks the world open like an egg. That's what happened to Titan. Titan didn't run out of food,it hit peak population, triggered an Emergence, and got destroyed from the inside out. Thanos tried to warn them to cut the population in half, and they called him crazy.
If Thanos uses the Infinity Stones to double the resources, what happens? Populations boom across every galaxy, hitting the Celestial threshold twice as fast and billions of worlds get obliterated by newborn Celestials. Cutting all life in half wasn't a random number. It was the exact reset switch needed to keep every planet below the Emergence threshold and buy the universe thousands of years of survival.
He couldn't explain the Celestials without breaking his own programming. So he called it "mercy" and let the universe call him a monster.