While they appear superficially similar and had similar effects, the Mexican currency crisis in 1994 and the Asian financial crisis in 1997 had fundamentally different causes.
Let's start with Mexico. Mexico's government has long depended on oil revenues. When oil prices were high in the 1970s, they were flush with cash, and either they thought this would go on forever or at least acted like they did. Mexico's government cut taxes and raised spending, which was fine as long as the oil revenue filled in the gap. When oil prices began to fall in the 1980s, Mexico had a huge fiscal deficit and no clear way to reduce it.
Things started getting better in the 1990s, in large part due to liberalized trade with the United States. This culminated in NAFTA in 1994, which had an enormous impact on Mexico, both in their real economy and on their financial system.
In the long run, NAFTA has been very good for Mexico. In the short run, though, they were simply not prepared for the sudden opening of their financial markets. As market circumstances changed on a daily basis, foreign investors rushed in, and then rushed out just as quickly.
Part of the problem was that Mexico fought to keep the value of the peso high and pegged to the dollar, so they could afford many new imports from the United States. This made them dependent on the United States. Due to market conditions in the United States, the United States' monetary policy varied substantially in the 1990s.
The peso became overvalued, leading to a large trade deficit. Worse, Mexico began to drain its currency reserves. Finally, they couldn't sustain the exchange rate anymore and allowed the peso to devalue; this created a sudden shock to Mexico's economy, triggering inflation. This was the direct cause of the crisis. This was the right decision in the long run, however, as a cheaper peso allowed Mexico to close their trade deficit.
Now let's turn to Asia.
The Asian crisis was primarily caused by the fall in value of the Thai baht.
Why did the baht fall? It appears to have been primarily a self-fulfilling panic. It's not clear what the triggering event was, but it didn't have to be much; once investors stopped believing Thailand's government and businesses could meet their debt obligations, interest rates rose, the Thai stock market crashed, and the baht suddenly lost value—and now there was a reason to panic. It was essentially a bank run, but against an entire country.
A leading theory is that the Thai banking system had improper risk management policy and a high level of corruption, which had been masked by high rates of economic growth. When growth began to slow down, these risks became common knowledge to foreign investors.
This panic also spread to other countries, particularly Korea and Indonesia because they had the most liberalized financial systems. To many investors in Europe and the United States (which is where most investors are!), Korea and Indonesia didn't seem all that different from Thailand, so it was better not to take the chance. They pulled their money out of those countries, too, and once again the panic which may have had no particular justification originally became self-fulfilling.
In both cases, the crisis was at its worst when the currency devalued, but this is not evidence that we should have fixed exchange rates. Rather, what seems to happen is that fixed exchange rates build up a kind of "pressure" (in the form of strain on current accounts and foreign reserves) that ultimately must be released. If you wait too long, it happens all at once and causes a disaster. Think of a currency peg as like a dam; if you allow water to flow through the dam gradually (or remove the dam entirely), things should be fine. If you try to hold the dam in place, though, pressure builds up until the dam collapses and floods the whole region. Economists should probably be working on ways to introduce flexible currencies gradually, so that countries which currently depend on a fixed exchange rate can transition rather than having the whole system collapse at once. (Sadly, I'm not actually aware of any economic research on this topic.)
Both crises also exhibit the very real downsides of free trade, especially the liberalization of financial markets. While the upsides are just as large (if not larger), I think many economists have done the public a disservice by not frankly discussing these downsides and how to mitigate them. There seems to be a general tendency toward "Yay free trade! Free trade is good!" among economists. This mentality can lead them to try to hide the downsides and exaggerate the upsides. Especially during the initial transition period, free trade can cause a lot of damage even though the ultimate outcome is generally good. We should be talking about means of preventing these sorts of crises—perhaps removing capital controls gradually, for instance, rather than all at once, or even retaining certain types of capital controls.