Hi amilk,
we've been to Spain and back last year in June-July for four weeks, although we didn't go as far down as Malaga. Our southernmost point was Alicante.
From there to the north, the seaside roads are definitely crap and packed with campervans, while the lower mountain ranges a little inward are beautiful, practically deserted and there's a lot of really beautiful scenic places (although most of them are not really famous). Pick any smaller roads and you will not be disappointed. I planned a lot ahead, and in reality we just took the roads we found fit to get us north, and were happy. Of course, like this, we haven't seen all of the roads there, but we were amazed by the beauty of the ones we picked most of the time. Not much to go wrong.
Be aware though, that there you will find solitude to a point where you will not find a commercial place to sleep or put up your tent. Same applies to petrol in some stretches there, so prepare for the odd longer leg without being able to refuel too.
Plan to cross the Pyrenees a little inward too, although this might mean to miss Barcelona. There's "Col D'Ares" which is sufficiently beautiful, if you don't want to go too far to the west.
A little more impressive are the cols Tourmalet and the other famous (Tour de France) ones (as well as the less famous smaller ones around there) which you will probably reach best via the Bielsa Tunnel (A-138/D173).
There's a Campsite in Roda de Isabena (Camping de Isabena) on which we stayed for a couple of days to explore the surrounding pyrenees. There, they offer a ride in a small helicopter for a very reasonable price, and i can't recommend it enough! It's just a great thing to do. Also, the Canyon d'Anisclo is a very scenic highlight close to this site. Plus you have a lot of smaller gravel roads of different difficulty levels around there, if you're fond of leaving the tarmac behind for a change.
Two of my favourite scenic roads in Spain were the BV-1221 connecting Manresa and Terassa (southbound, in our case, note the campsite close to Talamanca, which we dubbed "Camping de los muertes", as there were only four live persons, including us, and lots of desperately deserted trailers and tents reminding us of a Zombie movie - beautiful spot to stay...
), and the A-1606 connecting Benabarres and Laguarres (northbound, note the view over the plain towards the Pyrenees right after the highest point, after the left turn - not the safest place to stop and watch, but the view is well worth it.).
As general rule (at least for this part of Spain): If the landscape is flat, it will be a boring ride, but faster. You will find a bit more infrastructure, and it can be very hot and windy in the plains. Take the more mountainous roads to enjoy amazing scenery. It will be a lot slower, a bit cooler, and you will be on your own more often.
I wish you a good, safe and inspiring trip