Actually, the Reds did not win to decisive elections. The original 1931 elections were more centered around the formation of a republic versus keeping the monarchy. The people of Spain did not vote for radical Anticlerical wisdom, or forced land redistribution, Or Trotsky is him, or anarcho sydicalism.
When these interest began being pushed, the people of Spain voted for the CEDA party, The Reds responded with an attempted armed insurrection in Asturias where many innocent people were killed by the Reds. Then before the four-year term of Congress was up, the president who did not want to put the winning Catholic party in the government, called for another election which was marred by extensive read voter intimidation and fraud. In many cases left wing parties in the popular front self certified their own victories before official results were counted and then intimidated officials to prevent them from finishing counts. This is all extensively documented in Stanley Payne’s writings.
The coup only occurred after the left-wing elements conducted numerous assasinations, and after the left wing government sent a death squad for the leader of a legitimate party it was a sitting member of Parliament. In fact the military was incredibly restrained, if Franco was more like general Pinochet, another hero, he would’ve launched a coup far earlier that would’ve swiftly remove the Reds from power and saved many many lives, over a prolong Civil War that occurred because they waited believing democracy would prevail.