The director of the National Counterterrorism Center has announced his resignation, saying he “cannot in good conscience” back the Trump administration’s war in Iran.