Time frame is important with this question, as we have been involved in those countries for quite some time. I am assuming, since you chose those two in particular, that you mean our involvement with them in the 1970s and 80s when there were revolutions/rebellions in both.
At that time, the Cold War was still going strong, and as many times before, we had allied ourselves with sometimes brutal dictatorships in order to protect US business interests there and to keep those countries non-communist. To be clear, there was little threat to actual US national security if either of these countries actually had gone communist. They have little in the way of resources or exports that we need or needed. Companies like United Fruit and others, however, had large tracts of land ownership, and had for decades put pressure on the US government to protect their interests there.
In a larger social and political sense, Presidents Jimmy Carter and Ronald Reagan did not want to seem soft on communism and have the red shade of the globe expanded on their watch, so we gave large amounts of military aid to both countries - in El Salvador to fight the FMLN communist rebels, and in Nicaragua to try and save the Somoza regime, and when that failed, to fund a rebellion known as the Contras.
In summary, business interests mostly, but also larger Cold War containment and political image issues at home.
I would say that there were many issues that played a role in the United States' presence in Central America during the 1980s. One of the reasons was a fear of Communism. It seemed to me that there were two interesting dynamics at play during the time. On one hand, America under President Reagan had gone "all in" against the Russians. The feeling was that the Cold War was going to be resolved one way or another and the Russians would not be able to keep up with the accelerated pace of American military spending and defense initiatives. Yet, on the other hand, there was a foundational belief in the "domino effect," a holdover from the policies and practices of the 1950s and 1960s, where there was a definite fear that Communism can and would win over the "hearts and minds" of the rest of the world. American political interests in El Salvador and Nicaragua during the 1980s were geared in this light, as the genuine belief in stopping the Communist insurgency in these nations became the primary goal of American involvement. Events like the "Iran- Contra" affair became a testament to the level that the American government believed in defeating the Communist presence in this part of the world.
It is not clear what time period you are talking about here. There are a couple of different times in which the US was relatively interested in the affairs of these countries.
First, in the early 1900s, the issue at stake was keeping the Americas free of European influence. The US intervened in Latin American countries to stabilize them so that European countries would not occupy them. This was done as part of the Roosevelt Corollary to the Monroe Doctrine.
Second, during the Cold War, the US was concerned with preventing any government that might be communist from having control of these countries. This led to such things as US support for the Contras in Nicaragua.
Im looking for the 1980 Cold War Answer..
Thanks, in advance.