Ayala was born in Abalá, Yucatán, and studied violin with Revueltas and composition with Chávez, Manuel M. Ponce, Vicente T. Mendoza, Candelario Huízar and Julián Carrillo at the Conservatorio Nacional de Música, Mexico City from 1927 to 1932.
For a time he earned his living playing in the night club Salón México, a locale later celebrated in a well-known composition by Aaron Copland.
In 1934 he formed, together with fellow composers Salvador Contreras, Blas Galindo and José Pablo Moncayo, the "Group of Four" -- "Grupo de los cuatro."
From 1931 he was a second violinist in the Orquesta Sinfónica de México under Chávez, and directed a choir in Morelia for two years, but in 1940 returned to his native Yucatán to accept an appointment as conductor of the Police Band in Mérida.
As a composer, Ayala's first major success was with a symphonic poem, Uchben X'coholte (1933), whose title means "In an Ancient Cemetery" in the Mayan language.