"The War of the Reform was a Mexican civil war fought from December 1857 to January 1861, launched by the liberals and the moderate revolutionists dissatisfied with the Catholic Church's stranglehold on government affairs. The war ended with the Liberals being victorious and President Benito Juárez bringing his administration to Mexico City. "
"Faced with bankruptcy and a war-ravaged economy, Juárez declared a moratorium on foreign debt payments. Spain, Great Britain, and France reacted with a joint seizure of the Veracruz customs house in December 1861. Spain and Britain soon withdrew, but Emperor Napoleon III used the episode as a pretext to launch the French intervention in Mexico in 1862."
Juarez wanted to stop paying the debt because the country has bankrupt and much of the loans were made by the previous government, the European powers got mad and sanctioned Napoleon to invade. Hope that helps.