If both airports work, we often prefer Fes in, Marrakech out, or the reverse, so you can cross the desert once. Flying into one city and out of the same city means a loop, which is fine, just more driving.
Marrakech first is easier on jet lag: riads, orange juice, a garden, then the Atlas. Fes first is more intense — you meet the medieval city before you are softened. Some people love that. Others want Marrakech’s theatre first.
The Sahara sits between them. A 4-day Marrakech to Fes desert tour or a 3-day Fes to Marrakech desert tour is the spine we build most custom trips around.
If you land in Casablanca, do not force Marrakech the same afternoon unless the flight is early. Hassan II Mosque and Rabat are a better first night. If you land in Tangier, Chefchaouen is the correct first night, not a four-hour sprint to Fes after a ferry.
Tell us the tickets you already bought. We will not make you recross the Atlas to satisfy a brochure order.
Further reading from an official source: official ONCF train booking site (ONCF Voyages — Moroccan national railways).