You can also travel by train from Madrid to Algeciras. Then take the ferry to Tangiers, and the train to Casa or Fez, or Marakecch. Its more time consuming, but you get a chance to talk with locals and see some scenery.
If its your first trip to Morocco/Spain, I suggest "Lets Go" guide. They use to have a separate chapter for Morocco in the guide to Spain.
Also, check out the
www.lonelyplanet.com.
Very warm and kind people.