He was born in Madrid, Spain and raised in Mission Viejo, California. López-Alegría joined the United States Navy, where he earned a Bachelor of Science degree in Systems Engineering in 1980 from the United States Naval Academy, and a Master of Science degree in Aeronautical Engineering in 1988 from the U.S. Naval Postgraduate School. Designated a Naval Aviator in 1981, his fleet experience in the Navy was at Fleet Air Reconnaissance Squadron 2 (VQ-2) in Rota, Spain, and the U.S. Naval Test Pilot School at NAS Patuxent River, Maryland. A natural leader, he was the top Lieutenant of 60 in the second largest aviation wardroom in the Navy (105 officers). He made many connections with Spanish military and civilian personnel while in Spain during his first tour that have made him very popular and well known in Spanish media. He was one of the few EP-3E pilots in the squadron to get flying time in the EA-3B Skywarrior. He is a graduate of Harvard University's Kennedy School of Government Program for Senior Executives in National and International Security. He is fluent in English, Spanish, French, and Russian.
His son Nicolas starred alongside López-Alegría in 2006 in Mira La Luna (directed by Eduard Bosch). A second documentary, directed by Manuel Huerga, Son And Moon, was released in Spanish theaters in 2009 featuring astronauts Mikhail Tyurin, Sunita Williams, and himself.