You are trying to ask why a crazy person doesn't do what you think they should. Again go back to his history. He’s from a planet called Titan. Many years prior to the film his planet was experiencing a cataclysmic shift. They were running out of resources, and they were overpopulated. Thanos made a recommendation that they exterminate half the population randomly in order to save the rest of the population. To save many you have to sacrifice a few, is his thought process. Of course, the Titans rejected his notion, branded him a mad man, exiled him, and the planet ended up dying. That left this Mad Titan to experiment with his plan on a much larger scale. So he has taken it upon himself to go planet-by-planet throughout the universe and wipe out half of the population of each planet as a way to correct the universe and bring it back into balance.