Los Blancos, who were without Sergio Ramos and Nacho, headed into the clash with 3-0 lead from the first leg in Italy.
However, Juve took the lead after just two minutes in the second leg with Mario Mandzukic heading home Sami Khedira's cross.
Real pushed for an equaliser and they had the ball in the back of the net after 14 minutes through Isco, but the goal was ruled out for offside.
The home side's defence looked shaky without Sergio Ramos, as they were punished on 36 minutes as Mandzukic once again rose above Dani Carvajal to head past Keylor Navas.
Raphael Varane nearly reduced the deficit on the night but his towering header crashed on the crossbar just before the halftime break.
Juve were on the back foot for most of the start of the second half but they managed to make it 3-0 after an hour as an error from Navas gifted the ball to Blaise Matuidi, who poked home from close range.
The scores were level on aggregate but Los Blancos went close to taking the lead in the tie after 76 minutes through Isco, whose deflected strike was brilliantly tipped away by Gianluigi Buffon.
The game was then turned on its head deep into second-half stoppage time as Real were awarded a penalty when Lucas Vazquez was brought down in the box.
Buffon was sent off after his protests, although the long wait did not distract Ronaldo, who slotted away the penalty to put his side into the final four.