Note: At the time of writing September 2019 it is very common to buy insurance when booking a hire car on internet. When you arrive to pick up the car people are often told that the insurance that you have paid for while booking the ticket on internet is not valid and that it is necesary to purchase more insurance. This scam is very common.
It is no cheaper to rent a car when you are in Spain than booking it on the internet before you arrive.
The best thing to do is to visit several car hire websites and compare prices.
Here is a selection of Car hire companies who operate in Spain.
With the bigger companies you can pick up a car from one place and drop it off in another.
The banner at the top of the page is a seach system to compare prices from several providers.