James Bridenstine, a House Republican from Oklahoma, was narrowly confirmed to lead the nation’s space program, squeaking by in a Senate vote over unanimous opposition from Democrats who felt he lacked the necessary scientific background for the job.