I don't think so interrail is the cheapest way, if you live in Portugal and want to go to Morocco.
- in your country of residence (Portugal) you only get a reduction of 50% to the normal train ticket prices.
- you don't need to travel a lot in Spain.
So you need the Interrail ticket only for Morocco.
It should be much cheaper to buy a normal train ticket down to Tarifa or Algeciras to Tanger (Morocco).
The price for the ferry is about EUR 20 0ne way ...
and then to buy your train tickets in Morocco (not really expensive) ...