If you have only ten days, don't waste your time trying to get to Morocco. Tangiers isn't great, and there's plenty of much more interesting stuff in Spain that you can do with the time you will save. This side trip really isn't worth it.

I've never been there, but as far as I've learned Morocco's "signature" city is Marrakesh, on the foothill of Atlas Mountain Range which fortify Sahara Desert. Unfortunately, the only practical way to get there quick from Spain is a flight from Barcelona. The more convenient flights from Seville, Granada or Malaga don't exist. My advice, if you are well-budgeted, is to base yourself in Barcelona, then take a 3-4 days excursion by plane to Marrakesh, and another for Granada/Cordoba. The flight within Spain is cheap but Barcelona-Marrakesh run is probably a lil bit more expensive. If you are not that well-budgeted, I think your best bet is to cut some air travels and focus regionally, just like some TTers said. Barcelona - Marrakesh and Fes - Barcelona is also OK, otherwise focus on Northeastern Spain or Andalusia, all of which has a full range of attractions which would make short family trips worthwhile.