You really couldn’t be more wrong. The SOD has to follow orders just like everyone else in the President’s cabinet. He could quit or be fired over it but then he would simply be replaced by someone that would follow orders. If you have spent any time in the military, you would know how these things work in reality despite how you think they ought to work in fantasy land.
Sorry, but you are wrong. The Secretary of Defense position is a creation of Congress and the duties of the Secretary of Defense are enumerated in Title X of the US Code. Nothing in the Sec of Defense's Oath of Office requires him to follow ANY order of the President, much less ALL of them.
Whether he follows orders of the President is entirely discretionary and then only when the order of the President does not violate his oath of office, which is to uphold the laws of congress and the Constitution.