To support and defend the constitution of the United States. Thus we swear allegiance to the Constitution, the founding document of the US government and the federated states. We do NOT swear allegiance to an individual or to a specific office/office holder.
That is exactly correct. This idea that somehow taking the officer's oath empowers each officer of the armed forces as his own personal Supreme Court to construe and defend the Constitution as he/she sees fit is just silly.