Well, just as every country in the world wants to export stuff (clothes, commodities, manufactured goods, all the junk available on aliexpress) to the states and other rich countries, so do the cartels and criminal gangs in poor counties. They export to wherever they can make maximum profits. With respect to Cocaine, coca plants need rain forests, so one is left with Colombia, Peru, etc. Opium poppy is grown in Asia; Mexicans started poppy plantations in Sinaloa, they can make heroine.
Mexico is completely avoided when cocaine is sent to Europe from South America. Albanian mafia, Italians, and others use ships to transport cocaine from South America to ports in Europe. Mexican cartels are hardly involved in this. Same logic: why export to UK and other wealthy EU countries? More profit. If they were to sell cocaine to Iranians or Nigerians, they aren't going to make much money. Nigerians are also involved in Cocaine smuggling, because Nigeria is a transit point for some cocaine shipments from South America to Europe. Nigerian gangs get paid commission in cocaine for their help in transiting cocaine through their ports, so Nigerians sell the cocaine they obtain as helpers. That's why Nigerians use mules to send cocaine to India and other countries.
If Mexico were richer than Canada/USA, yes, people would be exporting drugs to Mexico.