He was the son of a treasurer of the cajas reales Antonio de Ayala y Tamayo and Josefa Vergara Azcárate y Caycedo. Born into a renowned family, considered aristocracy and a bureaucratic Dynasty in the 18th-century.[3]
Luis was brother of one of the main officers who had risen up against Nariño, José de Ayala y Vergara who was shot in public display in 1816 by the Spanish Empire, for his love and services to the new Republic, the same year of 1816.[4][5]
Before the revolution he worked in different treasury position such as accountant of the royal rent of Aguardiente, gunpowder and Tobacco. in 1801 joined the Sociedad Patriotica or Patriotic society; a group of the wealthiest families of the new kingdom created to promote the wellbeing of its citizens, from here Luis started participating in the Independence efforts.
As elector, a member of an electoral college of Cundinamarca for El Espinal Signed the definitive act of independence of Cundinamarca on July 18, 1813[6]
Ayala was also senior accountant of the superior court of accounts.