Well, I've heard a few theories on it, and the one I like so far is: Red Mage comes from Sharlayan.
According to the theory, Sharlayan was formed by dissident White and Black Mages during the War of the Magi who joined together and fled Eorzea to escape persecution. Founding Sharlayan they decided that knowledge should become the ends and not the means of their culture and philosophy. Red Mage as a class was formed from the two schools of magic as a safeguard in case they ever had to defend themselves either from Mhach or Amdapor, and when the colony was established in Eorzea, Red Mages were not permitted to travel there due to concern about the origins of the job.
This theory not only explains how Red Mage as a class was able to form (by being off-continent and away from persecution), but even ties in a few additional things such as the outfit looking similar to Sharlayan outfits from dungeons and tome gear. It can also explain one of the class's iconic spells, Haste, since Sharlayan is the only (known) nation which practices any form of chronomancy. The fact the class uses a sword and has high mobility and positioning abilities further adds up as a kind of anti-White/Black Mage class, since a mage is typically weak in melee combat.
As for why Red Mages are suddenly showing up in Eorzea and possibly passing on knowledge of their art, in one of the Letters, we learned that the current set of expansions are telling the story of the reformation of the Eorzean Alliance, and will not conclude until the end of 5.0/start of 6.0. 3.0 was about bringing Ishgard back into the fold. 4.0 will be about liberating Ala Mhigo and, no doubt, bringing them into the Alliance as well. Of the six nations of Eorzea, only Sharlayan would be left as far as the Eorzean Alliance is concerned. The sudden presence of Red Mages could be indicative of a faction in Sharlayan with strong partisanship from Red Mages who oppose the Bibliothecs (the Bibliothecs being the group of Sharlayans forcing Isolation and restriction on the sharing of Sharlayan Knowledge and art).
That's how the theory goes so far anyways. I may have missed some things.