They didn't.
Mexico remained neutral during WW1. The Germans tried to enlist their support by offering then Texas, New Mexico, and Arizona. The Mexican government turned down the offer and stayed out of the war.
They intercepted a message from Germany to Mexico to try to get Mexico to join the war
America never joined/allied with Germany in World War I and II. America was an ally and Germany was an axis. But America did join partially because of Germany. Germany announced that they would use their submarines on anyone and America felt threatened and decided they needed to take action. Germany also contacted Mexico and asked Mexico to help Germany defeat America.
Turkey joined Germany in World War 1
1916 Great Britain intercepted a German message to Mexico stating that if Mexico join Germany's side and fight the United States of America, that Germany would after winning the war would give Mexico back taken land, but after the British had intercepted this, and showed it to the United states, the United states were then forced to join the war.
The Zimmerman telegram was published in the United States on March 1, 1917. It was a coded telegram asking Mexico to join Germany's side on World War I and Germany promised that if they join them that they would get their lost and back from the United States. Here is what they lost to the United States: New Mexico, Arizona and Texas. The zimmerman Telegram was the last straw for the United State and on April 6, 1917 the United States declared war on Germany.
A time in 1914
Arthur Zimmerman
The Zimmerman telegram was published in the United States on March 1, 1917. It was a coded telegram asking Mexico to join Germany's side on World War I and Germany promised that if they join them that they would get their lost and back from the United States. Here is what they lost to the United States: New Mexico, Arizona and Texas. The zimmerman Telegram was the last straw for the United State and on April 6, 1917 the United States declared war on Germany.
March 22, 1942.
The war came to them when Germany invaded and occupied.
Germany had mesaged Mexico saying "If you join our side in the war... WHEN we win, we will give you all of Texas, and New Mexico"... When America heard this news, they were not hesitant to pick sides... Therefore, they fought for the allied powers.. =)
Alfred Zimmermann.