Mr. Gates, a former director of central intelligence, also said Mr. Trump’s recent trip to Langley was an “important gesture of respect,” but that he didn’t know what Mr. Trump was talking about when the president said there might be another chance to “keep the oil” in Iraq.