So I dug this up a bit, because I'm accustomed to the form "Méjico" in Spain.
You are right that México is written with an X but pronounced with a jota. However it has a special status of topónimo (place name), which sometimes don't have a translation (thank god).
E.g. "Washington" is not pronounced with a sharp S, it's just pronounced as in the original language. Or Wyoming is pronounced as "uaióming", not "bioming". Which is exactly what happens with México, in old spanish the X was pronounced as jota.
https://www.rae.es/dpd/M%C3%A9xico