Elections were scheduled for 1956 in north and south Vietnam to create a government for a unified state. When it became clear that the Communist Party would win the election in the north, the strongman in the south refused to participate. He was backed up by the U.S. government. Instead, prime minister Diem rigged a referendum, in which he "won" 98.2% of the vote, and declared a separate state in the South. Thereafter, the U.S. backed an illegitimate government, which we later helped overthrow in an even less legitimate coup. After 20 years and millions dead, we finally gave up.
The Vietnamese Communists were, indeed, communists. They would have created a centrally controlled economy, and limited political freedom, no matter what we did. However, they were nationalists first, fighting what they regarded as a war of national liberation against the French. Ho Chi Minh, the nationalist, Communist leader, appealed to the United States for help, and quoted the Declaration of Independence.
I believe that if we had supported democracy, Vietnam would have held elections in 1956. If we had spent our political capital promoting democracy, instead of merely anti-communism, we might have pushed for free elections, commitment to future free elections, and protections for religious groups that feared persecution. Ho would likely have won. He would have made a communist, or at least a socialist, state. BUT if we had supported democracy, and honored the results of the election even if our opponents won, the whole disastrous Vietnam war could have been avoided. Vietnam would be, at least, the kind of market socialism that it is today, without the decades of catastrophe in between.
If the United States supports democracy even when our opponents win, we will serve our interests, and the good of other nations, better than we do when we accept dictatorship in the name of stability and short-term gain.
If all the Middle Eastern dictatorships held free elections, some of them would be won by anti-American groups. But if we support the legitimacy of democratically elected governments over and over again, their periods of anti-Americanism will be shorter and less violent. Indeed, if we supported democracy consistently, there would be much less anti-Americanism to begin with.