Duh... because the people who lived in Mexico were Spanish? In case you didn’t realize, Spain fought on the side of Emperor Maximilian.
True, eventually Maximilian was overthrown, but then again, ultimately the Russian Marxists dominated Mexico in the 20th century.