It seems like it would have made more sense to fight alongside the Chinese Nationalist government against the Communists than let the Communists take over and try to contain them later.
Many reasons and factors go in to attempting to answer this but here goes:
US policy makers viewed the Nationalists as corrupt and completely incompetent at every single level. Stillwell was exposed to Chiang who went against nearly every single order he was given and generally was viewed as a bumbling fool. Chiang gave exclusive responsibility to his wife with regards to operating an pseudo air force. US policy makers interpreted this as an example of the blatant corruption within the Nationalist movement; the only person Chiang could trust was his wife.
Also keep in mind that the Communists and Nationalists had an 'allied front' against the Japanese in WWII. In actuality, more fighting happened between the two groups than in unison against the Japanese. Chiang was concerned with fighting two fronts: one against the Japanese during the War, and the eventual fight he would have against the Communists after WWII. So, Chiang diverted all assistance between the two fights. US policy makers interpreted this as incompetence.
Technology at the time was also a major factor. Any attempt at providing assistance to the Nationalists would be challenged by the topography of the land. Supplies and men would have to be dropped in. US air power saw tremendous growth in terms of quality and quantity from 1940 on. US air power 1940-1950, though impressive in its own day an age, would be pathetic when compared to contemporary air crafts.
This is just one perspective, that US policy makers couldn't trust Nationalist leadership enough to fully devote adequate support and resources to the cause.
edit: Changed "Japs" to "Japanese".
Proxy war referring to Korea is also somewhat suspect. There isnt a lot of evidence that China encouraged North Korea to invade the South. Nor did the US plan to fight China when they intervened.
In short form, the incompetence of the Chinese Nationalist government and the lack of knowledge about the possible strength of the Chinese Communists.
Up until roughly 1944 the Americans were pushing the idea of the Chinese as fighting independently in a 'united front' against the Japanese. In effect that basically meant accepting the status quo and routing all their aid through Chiang Kai-shek, and at the same time being unable to influence any possible reform that would have made shored up the corrupt and rickety structure of the Nationalists. They basically knew very little of the Communists and those junior members of the State Department such as John S. Service or independent observers such as the journalist Edgar Snow that were warning them about the possible revolutionary power of the Chinese peasantry were being ignored. It was very difficult to arrive at the Chinese Communist base in Yenan, so information was very limited and Zhou Enlai, the Communist representative, was downplaying their revolutionary aims in the hopes of securing American aid during the war.
In 1944, Stilwell's removal essentially marked complete American disillusionment with the Chinese Nationalists and a shift to the more pragmatic idea of just winning the war against Japan - so in the crucial years of 1944-1946 there was basically a policy of inactivity. Even when the American government finally sent the 'Dixie Mission' to contact the Communists in 1944 where they concluded the Communists would most likely win the obviously coming civil war, Ambassador Hurley decided to ignore it (believing the Russian claims that they weren't really Communists) and cut off contact. After the Communist victory he then blamed his own State Department officials for having sided with the Communists despite having ignored their analysis of their potential role.
At that point the American government wasn't really willing to put troops on the ground, especially in support of a Nationalist government that many Americans in and out of government saw as hopelessly corrupt and moribund, so when George Marshall couldn't broker a peace, he simply advised withdrawal.
So a mix of factors - the desperation to broker a 'united front', a misunderstanding and initial portrayal of the Chinese Communists as nothing more than agrarian freedom fighters, but above all the complete (and justified) lack of faith in the Chinese Nationalists after their experiences with Chiang Kai-shek during the war. Of course by the 1950s this suddenly looked like a terrible error, contributing to McCathyism and the idea of Communist sympathizers in the State Department.