The US went close on a couple of occasions before taking a shock lead, with Charlie Davies sending a bicycle kick two yards wide before Dempsey missed by the same margin with a low 20-yard drive.
Altidore, a 19-year-old forward from New Jersey, got the opener when he outmuscled Capdevila, his Villarreal club-mate, before finding the back of the net, despite the best intentions of Casillas.
It was the first goal against Spain in 451 minutes, since Turkey's Semih Senturk scored on 1 April, and only the third goal the Spaniards had conceded in 17 games.
Vicente del Bosque's men, who had beaten New Zealand, Iraq and South Africa to reach the last four, came close to equalising just before the break when Howard was forced to save low with his feet after Torres sold Bocanegra the sweetest of dummies from six yards.
This is an accident, a little step backward... we have to look forward with optimism
Vicente del Bosque
The pressure on the US defence increased tenfold after the interval, with Howard forced to make quality saves from Fabregas, twice from long range, and Sergio Ramos, who rifled in an angled drive at the near post.
Despite using up masses of energy in defence, the US made the most of their one and only break forward in the second half.
Donovan found himself free on the right, surged to the edge of the area before playing in a square ball that Ramos, oblivious to who was behind him, could only touch on to Dempsey, who fired in.
Bradley, who exemplified his side's tenacity, was sent off for a late challenge on Xavi but by that point his side had all but cemented their place in the final.
Del Bosque refused to be too downhearted after the shock reverse in Bloemfontein and insisted: "This is an accident, a little step backward. We have to look forward with optimism."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.