With nearly all of its territory surrounded by sea, Spain has numerous ports for sea travel. There are many relevant ports in number of passengers like the ones of Algeciras and Ceuta (that connect Spain with the north of Africa and the Canary Islands).
The company that has a bigger stake in pasenger travel by sea is Trasmediterránea, with daily shuttles between Algeciras and Ceuta or Tangiers. Also from Almería and Málaga to Melilla. To the Balearic Islands you will find ships from Barcelona and Valencia. The same happens weekly from Cádiz to the Canary Islands. From Santander (Cantabria) you can also go to the UK or France with Brittany Ferries.