The official, James R. Clapper Jr., the director of national intelligence, was testifying at a hearing of the Senate Armed Services Committee, where Republicans and Democrats defended Mr. Clapper and others just as Mr. Trump has questioned foreign involvement.