The military, DoD, CIA, FBI, et. al. have for a long time had somewhat different ideas about who actually runs the country vs. The People and their elected representatives. That's mostly business-as-usual
That their contempt for Trump should be all the greater in that he shares quite a number of their same attitudes but has the audacity to be about 10% radically different opinions in certain areas isn't too surprising, either. "not invented here"-mentality