Spaniard Contador finished 1min 40sec down on Malori on the rain-affected course as he took no chances.
But although he lost 27sec to Chris Froome, he did enough to add to his 2008 and 2012 Vuelta victories, taking his Grand Tour successes to six.
New Zealander Jesse Sergent and Australia's Rohan Dennis were second and third on the stage at 8sec and 9sec respectively.
But the day belonged to Contador whose gritty win on Saturday's 20th stage at Puerto de Ancares set the seal on an incredible triumph.
It was less than two months ago that the 31-year-old broke his leg in a crash that forced him out of the Tour de France.
Froome, too, broke his hand and wrist in a crash that also ended his defence of the Grand Boucle he won in 2013, but he did not recover as well or as quickly as Contador.
Neither managed a particularly impressive final timetrial but that was mostly down to the weather.
While Malori, the Italian timetrial champion, set off and came home in 11min 12sec under blue skies, sunshine and on a dry course, that was not the case for everyone.
A torrential downpour seriously hampered the middle order and by the time the favourites set off at the end, the roads were still wet, making the tricky, technical course treacherous.