Why was the US so determined to stop communism from spreading?

Because of the Domino Theory, which says if one nation falls to communism, then all of the surrounding nations will become communist.