This is a highly unusual question, as I've yet to hear of any nation where people didn't react favorably to their national team winning the World Cup. It's a prestigious thing to happen, to say you're at the top of a sport that most of the world watches. So yes, it would affect Spain in a positive way.
The celebration and commerce in the immediate aftermath of a World Cup victory would positively impact Spain, though I don't expect there would be a long-term effect. It is a sport the region takes extremely seriously and the elation would have money flying around the economy for a bit, but it's not going to stick around much further than the month it takes place in.
A world cup victory is a major accomplishment for any country. If Spain were to win it would have a large affect on the population. The World Cup puts you up against the best countries in a very tough format. A win will affect any country that is big on soccer.
A victorious FIFA World Cup squad always boost the home country. When the Spanish won it four years ago in South Africa, there was a week-long party in the Iberian nation. Brazil is certainly the favorite to win this year. But a victory for Spain will bring good cheer to a country that has seen its share of economic woes.
Assuming that Spain wins the world cup than I would think it would affect them, especially the sport fans and the people who are part of the world cup. It will bring joy to them and make them proud of the team that represented their country, so yes it would affect them.