Accomodation-> No, you don't need to book anything. Plenty of places to stay. Just look for these words: hotel, pensión, hostal, albergue. A pensión and hostal are normally cheaper than hotels and albergue is what you would call a backpackers hostel.
All of these normally have a blue sign with a capital H, and the corresponding number of stars depending of category...
Regarding the prices... nice hotels can be up to 100 €, but normal hotels in normal places are 50€ and less. If you go to a secondary road and search a little bit you will find beautiful hotels for 30-35€
Spain has lived from tourism for ages, there are lots of forms of accommodation. If you can identify one Hostal, it will be cheaper, while still having all the commodities of a Hotel.
Free camping is not allowed in theory almost anywhere in Spain, but it can be done if you plant your tent late and leave early. Also there is a ton of campsites on that route, but you will only see them if you get off the highway.
Petrol -> The least densely populated area you are going to cross is Teruel... but even there, it is almost impossible that you run out of gas with that range. Almost every village has a petrol station.
Don't worry, just do it. It will be a piece of cake