This is a very interesting topic btw.
First, you need to reconcile the actual number. Are we counting everyone who died under his regime? Or the people he deliberately and intentionally had killed? The difference between these two numbers is startling. If the first number, it's quite large. If the second number it's (for mass murdering dictators) quite small.
The article itself if that is where your quote comes from is already problematic. Less than 1 million people can be veritably attributed to Stalin during the purges. Throughout the Stalin period, the vast majority of people sent to Gulags actually left alive. The highest period of deaths via Gulag was during WW2.
The number of people who died during collectivization and the forced industrialization of the USSR account for the largest percentage of deaths under Stalin. We are talking about people who starved to death because collectivization simply didn't work. This is a failed policy. Then we can look at the Holodomor where several million Kulaks starved to death. This is another very interesting topic. Were these people victims of Stalinist nationalist liquidation? I'd hedge towards no, but it certainly played a role. Draught (Stalin can't control rain) + failure of collectivization probably played the biggest role, but Stalin certainly wasn't losing sleep over the famine. I'd say this is a combination of several issues. Draught/collectivization/Stalin not giving a feck.
At the end of the day less than 1 million people were deliberately ordered killed by Stalin during the purges, the article is completely wrong in its scholarship and research. In sum Stalin intentionally had 2-3 million people killed during his entire reign. Several million more died during his regime but I'm not sure it's fair to lay those directly at his feet. Otherwise we need to look at ourselves a little more closely. How many in the USA starved to death during the great depression. Nobody in their right mind would say FDR was a mass murderer for their deaths.
However, the crux of the issue is, were the deaths justifiable in the long term?
Is what Stalin did responsible for the USSRs ability to resist Germany? What was at stake? I would ultimately have to argue that yes, the ends justified the means here. The purges strengthened Stalins position in power. He eradicated the military establishment that could challenge him. He also burned out a lot of the old guard which were reluctant to embrace change in military doctrine and theory. One counter point to this was the murder of Tukhachevsky the author of Deep Battle doctrine. By establishing his position and wiping out any threats Stalin was able to make himself the spine of the USSR. Nobody could give up unless he gave up and he wasn't going to give up. This was a key aspect of the USSRs ability to hold out in the opening months of the German war.
Now we look at the 5 year plans. A lot of people died as a result of these. Both in the industrialization phase and the collectivization phase. One was a success, the other was a total failure. Millions died as a result of collectivization, lots died during industrialization as well. On balance which was more important? Well, industrialization. Without the forced industrialization of Stalins 5 year plans, the USSR isn't able to produce the tanks, planes, bullets, locomotives, trucks etc that allowed it to fight the Nazi invasion off. Collectivization was a major set back, but it was a setback that ultimately did not cause the state to collapse and it was therefore absorbable.
The question is, are the deaths of millions of citizens ever justifiable? This isn't a question that we as westerners can really ever answer. Our countries have never faced existential wars. If Stalin and the USSR fail in WW2, we're not talking about 11 million people murdered by the Nazi's. We're talking about the enslavement and eventual eradication of ALL of European Jewry, ALL Slavic peoples west of the Urals. We're talking about potentially over 100 million people that would be enslaved and eventually exterminated.
That is what you need to consider when you say "was it justified". Could they have done it without what he did? I would lean towards no.