David Villa scored twice and Cesc Fabregas missed a penalty as Spain defeated El Salvador 2-0 in their final World Cup warm-up game.