If you only have two days in Madrid you will waste too much time, and miss out on so much by travelling from and to an airport hotel.
I suggest that you stay in the centre, enjoy the city both day and night without the need to worry about catching the last train back, or paying the one way €30 taxi fare. There really is nothing of interest around the airport and dining options are limited.
If you stay in the centre there is no need to head back to the airport to collect a hire car. You can reserve and collect a hire car from any of the main car hire companies (Hertz, Avis, Sixt, Europcar) at Atocha station, which is located near to the centre and is well located for accessing the motorway network. Additionally, Hertz has another large office located at Calle Tomas Breton, which is also good for accessing the motorway network.
Edited: 5 years ago