Please don't try to see Spain and Portugal in four days on your way from Tangier to Marseille. You might be able to drive the most direct route between those two cities (which is roughly 1000 miles) in 20 hours with no stops for gas, toilets, food or sleeping, but that wouldn't be a sightseeing trip. And Portugal would be a significant deviation from the fastest route and make the trip even more exhausting.
I don't know where you plan to go after Marseille, but I'd plan to fly most of that distance if I could find reasonably priced flights. I'd choose one interesting place that would leave me with a not-too-long trip onward to Marseille. That could be somewhere in southern France or Barcelona. Barcelona has a very nice variety of sights.
It probably would not be practical to rent a car in Spain and drop it off in France because of the one-way rental surcharge.
Note that you will almost certainly have unbelievably hot weather in Morocco and most probably quite hot weather all along the path to Marseille. A destination with some indoor air-conditioned sights and/or beaches would probably be best.
Morocco is wonderful, so (weather issues aside) you could also spend the extra time seeing another part of that country. Your children will be fascinated by Morocco, for sure. That's what I'd opt for, but I have a pretty high tolerance for heat levels that others consider miserable.
Edit: I should have checked skyscanner.com before my original post. There don't seem to be many flights out of Tangier. For Saturday, July 29, I turned up a 5:45 AM to Lisbon, a 12:25 PM to Madrid, a 6:40 PM to Paris, and an 8:25 PM to Barcelona. There may be other options on other days of the week. You can probably pick up a good fare on the listed flights, but other destinations seem to be much pricier, and there are some rotten connections leading to 10- to 13-hour trips.