I know I don't have a lot of US military friends here, but there are a few. Remember that the oath of enlistment starts:
"I, _____, do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic;"
Before and above all, our allegiance is to the Constitution, not to any individuals. If our orders are un-Constitutional, they are illegal, and shall not, *must not* be obeyed.