Your best just staying in Espagne if you have just 7 days and visit morocco some other time, well that's what i would do due if a week is all i had.
That being said, 2 of the 3 places of interest i have mentioned above can be seen in a day or two, so if you were to push yourself i dont see why you can't visit morocco too.
info inc. accomodation based on budgets and classification of hotels.
Morocco Holidays, Short Breaks and Tours from The Best of Morocco
Hotels in Marrakech - Starred hotels, listed by categories
Marrakech Hotels - Discount Hotels in Marrakech at LateRooms.
Luxury Riads in Marrakech, Morocco. Book a Marrakech Riad Today with HipMarrakech - specialists in English Speaking Riads in Morocco. - excellent site.
i was'nt sure if you had accomodation arranged in Spain, so at present i only listed info. on morocco.