No, Thanos Was Not Justified
Thanos's motivation suffers from an issue that many sci-fi villain motivations suffer from: a problem that exists on Earth (in this case, shortage of resources) is forced into a setting where it should not actually exist (in this case, the entire Marvel Cinematic Universe). Thanos believes that the universe is too overpopulated to comfortably sustain its intelligent life for much longer, and so he decides to wipe out half of it Matthew 24:39-40 style. This will supposedly put the universe back into balance and let people keep on living in peace and plenty.
In short, he wants to wipe out a whole lot of people to prevent future pain and suffering. And some people who watched Avengers: Infinity War actually agree with him.
Note that the film does not take the position. Gamora points out that Thanos does not know for sure that the doom he predicts will come true. But let's for the moment assume that Thanos is more or less correct in his predictions that things will go very, very badly if allowed to continue as they are. Does this make his plan a good one? Do the ends actually justify the means here? Was Thanos the unsung hero of Infinity War? No, absolutely not. And here's why.
Why Thanos was not "heroic" in any sense.
None of the universe's citizens were given any say in the matter. Most people would rather live an imperfect life with some pain and suffering along the way than outright lose their loved ones or have millions of innocent people slaughtered to provide them a perfect, pain-free life. Although Thanos claimed his actions were for the benefit of the people, he never actually asked the people what they wanted. Instead, he simply decided he knew what was best for everyone and imposed his ideals upon them.
Thanos disregarded the psychological harm his actions would cause. By wiping out 50% of the sapient population, Thanos ensured that everyone would suffer the agonizing pain of losing any number of their friends and loved ones. Such trauma would stay with the survivors for the rest of their lives. If you are truly committed to reducing suffering, you cannot overlook the psychological toll your actions will have on people.
It wouldn't take any time at all for the population to bounce right back. A population reduced by 50% would easily rebound to what it was before in a few generations, if that. Consider right now (2018) that the world population is around seven and a half billion. It was approximately half that as recently as 1964. Europe's Black Death wiped out about a third of the population in the 14th century; it was back to its old levels by the start of the 17th - barely a blink of the eye on a cosmic timescale. So not only was Thanos's plan cruel, but it was also all for nothing.
There were alternatives. Let's assume for the moment that the Infinity Gauntlet can't just poof new resources into existence, and that it can only work with what's already in our universe. Even under these conditions, there were plenty of alternatives. One of them would be to start moving everyone into Dyson swarms (essentially, many space stations surrounding a star), which are far more space and resource-efficient than planets. Given the numbers of highly advanced spaceships we see in The Avengers, Guardians of the Galaxy, Guardians of the Galaxy II, and Thor: Ragnarok we have no reason to think that space habitats could not be built en masse for this.
In addition, there are many nonviolent means of curbing population growth. One method is to provide ubiquitous education for all genders - in other news, Thanos's times would have been better spent creating schools and fighting for women's rights. Here are some other nonviolent methods - which you'll note all involve bringing up people's quality of life and personal security substantially. If we humans have figured these facts out in our own 10,000 year old civilization, many far older civilizations in the MCU have surely figured it out as well.
And then there's the fact that a universe only has finite resources of it's a closed system... and the MCU is not a closed system. As established in Doctor Strange, there are infinite other universes out there. Some are friendly to life, some aren't. Sorcerers learn to tap into at least some of these universes to draw power for their magic. In other words, it should be possible to tap into a universe that's high on energy but unsuitable for life in order to provide extra power to this one.
Another alternative would be to genetically alter everyone so that their fertility decreased as population density grew. Thus the population would dwindle down to reduction of 50% in a generation or so and remain fairly stable in the long term. While still ethically questionable (altering people's bodies without their consent is generally not a cool thing to do), it would still get the job done with far less outright cruelty.
So no, Thanos is not a hero in any sense. His plan in Avengers: Infinity War is cruel, ineffective, and unnecessary. Given that he never tried any of the alternatives listed above, it's safe to assume that he never even bothered to see if any alternatives existed in the first place. Good people don't always make ideologically pure decisions, but they do at least try their best with the circumstances they've been given, and it's clear that Thanos never truly tried at all.
Does Thanos employ Type 4 morality as described on this page?
I've had more than one person raise concerns that Type 4 morality (Consequential) encourages the exact type of extremism as committed by Thanos. It doesn't. If anything, Thanos is Type 2 (Oppositional). He believes himself to be a good guy simply because he opposes something bad. Because of this, any and every action that serves his purpose is justified in his mind, no matter how heinous it is.
Genuine Type 4s try to maximize fairness, and there's nothing fair about genocide and making people watch their loved ones die. They also make a genuine effort to find the least-harmful solution they can, and Thanos obviously didn't try, given how many alternatives are available.
Long story short, Thanos is nothing more than a short-sighted and self-righteous asshole. He might have a fascinating motive, but he still caused unnecessary harm and trauma.
You might also be interested in:
"Is This My Character's Fault?" - A Flowchart
Ethical Considerations For Fantastic Situations - Are Your Sci-Fi & Fantasy Heroes Ethical People?
How To Write Sympathetic Antagonists Without Endorsing Or Excusing Their Actions, & Without Making Your Protagonists Seem Heartless
How To Keep People From Admiring & Idealizing Your Villains