The Spanish capital is quite unlike any other major city on the Iberian peninsular, sitting as it does in its own basin. If your usual idea of Spain is a Mediterranean coastal resort then dry Madrid is quite different, but what it lacks in water, it more than makes up for in cultural attractions and nightlife.
Conclusion – Do you need a car in Madrid? I have visited numerous different places in Spain, and hired a car in many of them, but I really struggle to think of a good reason why there is any need to get a hire car in Madrid. Do you need to hire a car in Madrid? Of course, you might well want to get out of the city, but unless you plan to explore a particular region away from Madrid, public transport is just a great deal more flexible.