WASHINGTON—The Senate confirmed Gina Haspel to be the next director of the Central Intelligence Agency, making her the first woman to lead the nation’s premier spy organization.

Ms. Haspel, 61 years old, is only the second person to lead the agency after spending almost an entire career undercover. She rose through CIA ranks from junior case officer to hold senior jobs in counterterrorism and covert operations.

Her...