Hi Tony,
Hotels are more expensive in France than in Spain.
I Went to Morrocco 4 weeks ago from Lorient.
Lorient; left at 6 in the morning, arrived at 22h at 100 or 120km south of Madrid. Cheap, and very clean, hotel on the motorway.
Left Madrid at 9 in the morning, find an hotel at 17h in ... the medina of Chef Chaouen (with my Nissan Patrol GR).
Lorient - Algesiras = 1980km by the motorway: Bordeaux, Madrid.
The motorways are free in Spain (just some few km you will pay for) if you go by Madrid, and there is nobody on (except in Madrid, that you must cross when people are working or sleeping), otherwise you will have to pay if you go by Barcelona, and there are lots of trfic jams.
Autovia = 2x2 ways, free
Autopista = 2x2 ways, need monay
Cheap hotels in Spain: that ones on the border of the motorway, with restaurants. Don't need to book for them. price is between 25 to 50€ for 1 room. Ask for a safe (closed) place for your car, it must be free of charge.
2 years ago, we went off the motorway, in a village near the motorway, ask for an hotel, find a room, food,
, breakfast, safe car park,... for 30€ (2 peoples) It was near 120km in the South of Madrid.
It will be much more expensive on the south coast near Malaga.
Around Malaga you can find a lots of campsites. I never went in.