That's a very good question. Ditto, the Netherlands. Certainly, Spain now has a pretty serious economy (the world's eighth biggest, in fact) but, as something of a latecomer to both democracy and the membership of major international institutions, it is not part of the G20. What seems to have happened is that when the first big we're-in-meltdown-what-are-we-going-to-do-about-it jamboree was held in Washington late last year, France found itself with two seats (as a G20 member, and as then president of the EU). Spain and the Netherlands lobbied furiously for the spare one, and Spain won. Then the Netherlands sulked, and because it has a financial sector out of all proportion to its size, everyone took pity. And, of course, it was only fair that everyone who attended the Washington party should get an invite to this one. So there you are.
Those key G20 questions answered - The Guardian