Smart decision to plan to tackle only part of Spain on this trip; it is a huge country. However, have you taken a look at the July temperature statistics for Andalucia? It is entirely possible it will be over 100F every single day. If your next trip could be at a different time of year, I'd recommend that this trip be to the north.
Weather concerns aside, I think you are trying to cover a lot of places.
Have you used viamichelin.com to check the driving times for each proposed leg of the trip? Those times do not include stopping, getting lost, looking for parking, or walking from the parking lot to where you want to be.
Have you gotten tickets to the Alhambra? If not, you need to work on that just as soon as your schedule is solid. Tickets sell out months in advance, so you're probably going to have to do something special to get tickets. You will not be able to have much time at the Alhambra with only one night in Granada, making two stops on the way to the city and two on the way out. You may not be aware that tickets to the Alhambra are timed. If you miss the entry time for your visit to the Nasrid Palaces, you will not get in. And the Alhambra is not the only worthwhile sight in the city. So, yes, I think you need two nights there.
I'm finishing up some time in Spain that began with about 4 weeks in the south. I visited some of the other places you've mentioned in 2016. I have very definite opinions about which of your destinations I would cut in order to allow more time in the remaining places. Obviously, there's room for disagreement, but when you are short on time in places like Granada, I think it's time to take a look at the value of the secondary locations.
The direct drive from Salamanca to Toledo will take at least 3 hours (plus stops, parking, etc.). I would not want to spend one minute of my remaining time in Avila, which is not even a shadow of Toledo (or even Salamanca, or the missing Segovia).
I haven't been to Consuegra. I liked Ubeda, and I'd like for you to keep it on the itinerary because it's quite different from the other southern cities on your list, but you don't have enough time for Granada. The straight drive from Toledo to Granada will take about 4 hours. Detouring to Ubeda will cost an extra 50 minutes (assuming no navigational problems and the immediate appearance of a parking place when and where you need one).
I haven't been to Nerja or Frigiliana, but I'd drop the coastal villages as just not being as interesting as your other destinations, unless beach time is a must. Malaga is a pleasant place. I enjoyed my time there. But it is not Toledo, Seville, Cordoba or Granada. Or Ubeda or Salamanca. What it comes down to is that I think unless you especially want to see the Picasso Museum in Malaga, a second day in Cordoba will be considerably more interesting than a first day in Malaga.
I don't know whether it's practical to hit all three white villages as you drive from Ronda to Seville. I haven't checked viamichelin, but I know you can't make great time on those roads. Ronda, Grazalema and Arcos are nice places; I assume Zahara is, too, but I am doubtful about the practicality of squeezing them all in. Don't forget that you'll want to sit down to a good meal from time to time on this trip.
I like the time you have in Seville. I don't know whether combining Jerez and Cadiz into a single day-trip will work. I think some folks have mentioned spending a good bit of time at the horse show, and then there are the sherry places. I've only been to Cadiz.
I wouldn't want to spend my last night in Cordoba before a transatlantic flight out of Madrid. Once in awhile you run into something like a train strike or major delays. The price of missing that return flight would probably be very high. I'm conservative about positioning myself for flights; if something goes wrong, i want to be an affordable taxi ride from the airport.