Castillo was born in Ixhuatlán de Madero, Veracruz, and received a bachelor's degree in civil engineering from the National Autonomous University. An accomplished engineer, he taught several courses at the UNAM and at the National Polytechnic Institute, wrote several textbooks and invented the tridilosa.
He became a political activist and got involved in several workers' rights struggles, leading to imprisonment by the federal government in the infamous Lecumberri Penitentiary. Castillo was one of the first among leading left-wing politicians to express dismay at the dictatorial nature of Soviet-bloc governments, starting a movement towards a social democracy-based left wing and away from a Moscow-based left leaning opposition in Mexico.
During his lifetime he co-founded three political parties: the Mexican Workers' Party (Partido Mexicano de los Trabajadores, PMT), the Mexican Socialist Party (Partido Mexicano Socialista, PMS) and the Party of the Democratic Revolution (Partido de la Revolución Democrática, PRD). In his last years in politics he became a staunch critic of the Zapatista rebellion in Chiapas and, crucially, voluntarily withdrew from the presidential race in 1988 to support the unified candidacy of Cuauhtémoc Cárdenas.
- Sam Dillon (7 April 1997). "Heberto Castillo Martinez, 68, Leftist Political Leader in Mexico". The New York Times. p. B 9. Retrieved 22 August 2020.
- (in Spanish) The Heberto Castillo Foundation