Actually, I think your plan is a mistake overall. No offense or disrespect intended, I just think you're making a fundamental (albeit very common) mistake.
You want to go to Morocco? Good - it's amazing, it's easy, it's great. Go! Just don't do it as a "day trip" and if you can manage a few days (which it sounds like you can) then by all means do NOT take the ferry. Why? Because then you get a crass, fake, manufactured-for-tourists, hassle-filled experience and you don't actually get to see/experience the country.
Think of it this way: Morocco is to Europe as Mexico is to the USA. The parallels are numerous and surprisingly valid.
For western Europeans, Morocco (and nearby parts of North Africa) is a primary source of: cheap fun-in-the-sun vacations; interesting food; a fascinating different culture with a rich history; intense contrasts; low-cost labor (legal and otherwise); and lots more. The same way that Mexico is for the USA.
As an American (or a visitor to the USA), if you wanted to experience Mexico, the worst possible thing you could do would be a "day trip" to Tijuana or some other "bordertown". The worst.
The same thing is true for Morocco. Substitute any of the ferry ports on the north coast of Morocco for Tijuana, Brownsville, Nogales, or other Mexican bordertowns. Ewwww.
So what's better? Forget the ferry ports. Fly. Yes, fly - to the places in Morocco that you actually want to go to: Marrakech or Fes. For a first-time, short, dip-your-toes trip, these are the perfect places to go. You can fly to Marrakech or Fes from a dozen different cities in western Europe (including several in Spain) for dirt-cheap on several low-cost airlines. It's easy. You don't need a tour package (if you don't need one in Madrid or Barcelona, you don't need one in Marrakech either). Go for a day or two, experience the more authentic parts of Morocco, then head back. You won't spend much more than taking the ferry and you'll have a chance to actually see what's worth seeing.
Unless you actually like the Tijuana experience. If that's the case, ignore everything I've said.
Just my 4 cents.