you are confused by your (very common in the West, especially among leftists) belief that the use of WMD in a world war is the “end of the world”. The Russians never thought that way. They thought (and still think - I read their newspapers regularly) that nuclear war, epidemics etc can kill plenty of people, maybe 9 digits worth of people, but the world wouldn’t end because of that.
Destroyed cities will be rebuilt, industry restored, new people born and so forth. Casualties will be heavy, but nothing catastrophic , let’s say 50% of the population, not 99.99% as you are suggesting. Cities will be evacuated beforehand by the (back then) excellent Soviet civil defense organization, and there will be (they did in fact make sure to do this) enough food stockpiled to kept everybody fed for a year or more. FYI in WW2 Germany lost 12% (mostly young men) and no problem, they are still there on the map. Postwar Russia with a smaller population but higher birthrate (birthrate usually improves after wars) can be no different.
Destroyed industry can be rebuilt quickly - again, just like destroyed German industry was rebuilt. People will move from radioactive areas to clean ones, just like they moved from Chernobyl area. There is plenty of clean land on the planet that will be up for grabs for the victor, e.g. entire South America, Australia and Africa, among others, and Russia itself, mind you, is huge and thinly populated. Also, radioactive poisoning of the land is not forever - the intensity will greatly decline within several decades. And even if people have to live on some of the bad land, they will just have higher rate of cancer and 10 years less average life expectancy - so big deal. The Party officials and the generals themselves will live elsewhere, you understand.
Incidentally, note that the highly centralized command economy like that of the Soviet Union (or to lesser extent modern China) is inherently better suited to the chaos of nuclear war than American free enterprise. That’s why the military itself is not free enterprise but a classical centralized command economy. Well, the Russian military strategists knew that. American government also knew that long time ago, that’s why e.g. during WW2 America had a command economy with heavy state management of investment and production by the nominally private enterprises.
So that basically should answer your question. Soviet Union thought that if worst comes to worst, they can at the very least conquer Europe, at best maybe even America. Would a lot of people die, economy get ruined, and environment poisoned? Sure. But look at the bright side - the triumph of world socialism, the motherland saved from the evil machinations and threats of American imperialists and so forth. All the leading generals given shiny medals for conquering the world. Plus, whatever happens in the uncertain future, RIGHT NOW the generals in charge get bigger budget to play with - and you can always find interesting ways to spend the cash as long as the government keeps handing it out.
Also, the “better dead than red” slogan you are referring to does not necessarily mean that the world should be destroyed to stop communism. It’s just a restatement of “libery or death” slogan, sort of like what the Cuban regime writes on its murals. What it means is that (according to people who agree with it) Americans should fight and suffer heavy casualties rather than surrender to the Communists (Russians). This is in direct opposition to the counter-slogan of the times “better red than dead” pushed by leftists who argued that since nuclear war is so scary and Soviet Union so determined, we might just as well unilaterally disarm in the face of this threat - sort of “relax and enjoy” when faced with inevitable rape.
Now, you are free to disagree with Russian theories explained above. Some people say that nuclear war will kill everybody. Some others at various times said that AIDS will kill everybody, or that everybody will die an agonizing death because of the ongoing catastrophic loss of endangered species. Different people have different opinions about what the future may entail. I am just trying to explain to you the opinions that underlie the military strategy of Russia, China (look back to Mao’s quote about China surviving the war) and to some extent America, at least at certain points of its history.
You are of course free to call this “evil stupid rightwing propaganda” but there are plenty of people in Russia and elsewhere who consider this a reasonable analysis. A lot more reasonable than the “OMG, nukes! the horror!!” screams that pass for argument in some sections of Western discourse on the matter.