- It is often possible to hitchhike with truckers ("camioneros") onto a boat to Morocco, without having to pay a ticket. Read more from Hitchwiki.
The cheapest ticket on ferry to Morocco costs 25 euros(in november 2017). Ceuta and Tanger ville are more expensive than Tanger Med but it is just industrial port about 40km from Tanger. With most of companies bicycle is included in price so you dont pay anything extra for your bike.
Around the harbor are plenty of supposedly "cheap hotels" for around 10€/night. However, the waiting hall for the ferries is open 24/24h, is actually safe, controlled and also some other people (locals/homeless/travelers) sleep in it.