No ferries have operated between Spain and Morocco since March 2020. The borders to the Spanish enclaves of Ceuta and Melilla are also closed. The only way to get [a vehicle] to Morocco is from Sete or Marseille in France, or Genoa in Italy.
There was talk of a new ferry route from Portimao in Portugal to get round the Straits impasse, but nothing’s happened. Another new route between Poole and Morocco is only for freight. See latest posts on this thread.
See also: Documents and Port Immigration
Most travellers from the UK heading to Morocco in the cooler months take the ferries from Portsmouth to northern Spain: Bilbao or better still Santander. When you add up tolls and fuel and time across France it works out the same price for less driving or riding.
The Brittany ferries on this route are well-equipped cruise ships with plenty to occupy you over ~22 hours at sea, while doing a great job of smoothing the voyage across the Bay of Biscay. Brittany also have a no-frills ferry route between Rosslare and Bilbao.
From Santander to Algeciras (the most-used port, until the current impasse) is about 1000km, and the empty and fast network of roads west of Madrid (A67, A62, A66 and A381 – right) can get you between the two ports in one long day if you wish. The only short section of toll (peaje) is south of Seville.
On a motorcycle, from the UK you can save at least two days each way but getting it trucked to a warehouse near Malaga. I used Fly and Ride in 2017. I delivered my bike all loaded up to a warehouse near Gatwick, then flew in and picked it up an hour’s walk from Malaga airport a week later. Post Brexit it now costs £895 one-way, plus Customs charges. I’ve since used removal companies from £420 one way (pre-Brexit price). See this thread.
Moroccan Ports [are closed right now]
Now that Tan Med port is so easy, few go via ‘Tangiers City’ or the nearby Spanish enclave of Ceuta (Sp), although from Alicante, ferries to Melilla enclave (Sp) are often much cheaper than adjacent Nador. The payback can be that on the Spanish side of the land border with Morocco you’ll have annoying ‘helpers’ offering their services. They’re just looking for a tip at the end of it, but on a quiet day, you can manage without them.
Moroccan port maps