I understand the beginning of this post, there are many duplicitous actions taken by the government, regardless of who is in power, which oftentimes seems totally contrary to what might appear reasonable. In some cases, the main or even only real solution to "why" is that most of the world is lost and serves the devil (even if unknowingly).
World War Two could have rather easily been avoided, yet due to much bungling and lack of future considerations, the world was plunged into a war which continues to reverberate around the world. In the midst of the war many more unwise, unethical and not in our best interest actions were taken by our government (and not ours only).
Back to Korea: once America successfully landed at Inchon, and broke out of the Pusan Perimeter, taking clear offensive advantage, that war should have been won. Even after the Chinese "volunteers" entered the war, America had the clear advantage and could have secured victory but government leadership failed. This process would repeat itself in Vietnam in worse fashion.
Republicans or Democrats in power, in the modern era America has sided with communists, Muslims, terrorists, tyrants, dictators, mass killers, the ungodly time and again. Mostly this has been for the sake of hopeful short-term gains with little regard to possible long-term consequences.
Reagan and Bush both armed various Islamist insurgents, terrorists, dictators, for a variety of reasons; often in the name of Cold War strategy. Notice in the case of Israel, Dems and Repubs alike have been against accepting Jerusalem as the capital of Israel, have pressured Israel to give up land "for peace", aided in the establishment of "Palestinian" enclaves with an eye to establishing one or more "Palestinian" countries, pressured Israel to halt her military after each war with Arab neighbors rather than gaining a more decisive victory, called upon Israel to allow more non-Jews into Israel and to grant them full citizen rights (which would quickly lead to non-Jews having a majority control of Israel if implemented), and have only aided Israel in so much as it's been seen to benefit America and when they can tie strings to the help.
I'm not sure what you are trying to say regarding Quadaffi.