Whatever US soldiers were doing in Afghanistan, they weren’t acting pursuant to oaths they took to support and defend the Constitution. From Jacob G. Hornberger at fff.org:
In a letter to the Los Angeles Times regarding the Afghanistan debacle, Stephen Sloane, a retired captain in the U.S. Navy who served in the Vietnam War, is a perfect demonstration of how so many people, especially in the military, live lives of denial when it comes to foreign interventionism.
Addressing Marines who served in Afghanistan who are now frustrated and angry over the result in Afghanistan, Sloane tells them that there is no disgrace in defeat because U.S. soldiers “took an oath to the Constitution.” He says, “Loyalty to that oath has helped preserve the right of Americans and others to life, liberty and the pursuit of happiness for more than 200 years.” He points not only to “the failed effort to keep Afghanistan out of the hands of the Taliban” but also to “the failed effort to keep Vietnam free from communism.”
That’s just sheer nonsense.
Loyalty to the president
While U.S. soldiers technically take an oath to support and defend the Constitution, as a practical matter their oath is to serve the president and unconditionally obey his orders. Since the president is democratically elected, in their minds they are supporting and defending the Constitution when they dutifully and loyally obey the commands of their commander in chief.