Answer:
The reason for entering the two countries is the same: the Truman Doctrine and the belief in the domino effect.
Step-by-step explanation:
The Truman doctrine was the foreign policy of president Harry S. Truman, which continued in some way until the fall of the Soviet Union in 1991. According to this doctrine, the main goal of U.S. foreign policy was to prevent the expansion of communism around the world.
The Dominio Effect theory is a justification of this doctrine, and stated that when a country becomes communist, very soon all neighboring countries will become communist as well, as if dominoes were falling.
Whether the U.S. should have entered these two wars is a complicated question. At least in the case of Korea there was some sort of success since a part of the country, South Korea, became part of the U.S. sphere of influence, so in this sense one could say that the intervention in South Korea was worth the effort.
However, the intervention in Vietnam would not have any justification by the same logic since it was a very costly defeat to the United States that did not result in any positive outcome.