I don't know how history is told in most countries, but I was taught that anti-communism was big in most of the world even before the Russian Revolution in 1917 and the Cold War. The formation of the Soviet Union only increased those fears.
I was taught that France and the United Kingdom were lenient with Germany violting the Treaty of Versailles of 1919 during the years preceding WW2 because they were hopeful that the nazis would direct their anti-communism towards the Soviet Union. Similar anti-communism sentiments existed in the US, given the treatment of Eugene V. Debs and the crushing of many worker strikes.
And if we see the results from WW2 from a anti-communist perspective, the worst outcome almost happened: almost everything from eastgermany onwards was now socialist. Japan was almost taken by the USSR. The world was now multi-polar and the Soviet Union was a superpower. Many socialist countries started emerging and western colonialism would soon cease as it was.
If I were an enemy of both the nazis and the communists, I would have likely just waited out until both sides destroyed each other or the remaining one was crippled. If it was about protecting allies, why not just protect the UK and maybe liberate France? The Soviet Union might have pushed backed Germany on it's own and them start to steamroll it like it happened, but Germany could've won and be depleted, leaving it open for the UK and the US to strike it. You either would defeat both of your enemies, or one of them would be completely defeated.
Given that situation and mindset, why did the US help the Soviet Union at all? They could ensure the safety of its allies while their greatest threats destroyed each other.
The vast majority of people, even anti-communists, felt that Nazism was a greater threat than Communism. Churchill is a good example of this, as he was about as anti-communist as world leaders came. He had a famous quote:
If Hitler invaded Hell, I would make at least a favourable reference of the Devil in the House of Commons.
When Germany invaded Russia, Churchill made a speech in a radio broadcast:
We have but one aim and one single irrevocable purpose. We are resolved to destroy Hitler and every vestige of the Nazi regime. From this nothing will turn us. Nothing. We will never parley; we will never negotiate with Hitler or any of his gang. We shall fight him by land; we shall fight him by sea; we shall fight him in the air, until, with God's help, we have rid the earth of his shadow and liberated its people from his yoke.
Any man or State who fights against Nazism will have our aid. Any man or State who marches with Hitler is our foe...
It follows, therefore, that we shall give whatever help we can to Russia and to the Russian people. We shall appeal to all our friends and Allies in every part of the world to take the same course and pursue it as we shall, faithfully and steadfastly to the end.
We have offered to the Government of Soviet Russia any technical or economic assistance which is in our power and which is likely to be of service to them. We shall bomb Germany by day as well as by night in ever-increasing measure, casting upon them month by month a heavier discharge of bombs and making the German people taste and gulp each month a sharper dose of the miseries they have showered upon mankind.
https://www.jewishvirtuallibrary.org/churchill-broadcast-on-the-soviet-german-war-june-1941