There were many reasons why the United States was afraid of communism, or why they did not think it was convenient for them if communism spread. The United States wanted to be the main superpower following WWII. Its competition had greatly been reduced due to the destruction that took place in Europe. However, Russia was still a great power, which threatened American supremacy.
Moreover, the United States had developed nuclear weapons, which they had used against Japan. When the Soviet Union began to create their own nuclear arsenal, the United States was worried about what could happen if two countries did not get along and they both had nuclear weapons. However, neither one of them wanted to give them up.
Finally, the United States believed that its economy was going to improve even more if they had unlimited access to the markets of the whole world. As communism was spreading in the developing world, they were worried that this was going to lead to countries being less open to American exploitation.