First things first- David Villa was not offside.
Too close to definitively call, in which case no call was the right call.
At least half of his body is even with the defender on the far side, so it is a classic 50/50 that could be argued wither way. Given the nature of the movement of the players, it was a pretty impossible call for the linesman to make and have confidence that he was right. Tough luck to Portugal, but for me the goal is legit.
And while the whole world is talking about Villa and what a beautiful team goal it was, and rightfully so, the key to this goal is the off the ball run by Xavi which ends up leaving Villa alone unmarked. Watch this video and pay attention to the 1st 7 seconds and then from 0:45 to 0:52 to see how Xavi's penetrating run unlocked the Portugal defense.
Xavi runs into the Portugal box, and because 2 Portuguese men are covering both Iniesta and Llorente, the Portugal right back has to move over to cover Xavi or else he will be through on goal unmarked. As a result Villa is left alone, and you can clearly see that Portugal right winger Simao is caught flat footed and realizes a moment too late what has happened; by the time he runs back to cover Villa, Villa is through on goal and it's 1-0 to Spain.
A beautiful and simple illustration of how moving away from the ball the the key to effective team passing play, and one of the most beautiful team goals to be scored at this World Cup.
So Villa is getting all the credit, but make no mistake- Xavi made the goal, first with his off the ball run into space and 2nd with his sublime pass to the onrushing Villa. You will notice that Xavi, and not Villa (who was himself immense over the 90 minutes) was named Man Of The Match. No different than at Barca the past couple years, where Messi, Eto'o, Henry, et al get all the plaudits but it is Xavi & Iniesta who are the 2 keys to the team, the 2 straws that stir the Barca drink, and the Spain one as well.
At 1-0 up Spain were in the catbird seat. As they are the best team in the world at keeping possession, they now could spend 50% of their time playing keep away and making Portugal chase the ball and thus get tired doing so, and the other 50% trying to open up the defense and score the 2nd goal. This exact scenario is the key to Spain's World Cup- I will write more on it shortly, but I am confident that if they score first from here on out they will not come from ahead to lose.