The median income in Spain (2021 PPP intl $) is $11,800, while in Germany it's $16,900. That's a massive difference that, I assure you, does not make up for the hypothetical difference in cost of living.
We can't really say that the EU has failed in smoothing out the income differences between regions because in reality it was never designed to do that.
Yes, the bureaucracy pays lip service to that, but the actual institutional structure is not design to do that, but to subsidize corrupt politicians and their cronies in the South (and for the last couple of decades, the East), in exchange for a free market and cheap labor for German industrial exporters and of course, the German central bank (currently called "European Central Bank").
The useless, largely unsupervised subsidies are grossly and corruptly misused to capture votes and create crony networks while propping up inefficient, detrimental zombie sectors, keeping the recipient countries undeveloped and increasingly deindustrialized.
The main culprit historically speaking was France, of course, who sought to repeat another Treaty of Versailles of sorts making the Germans pay for its completely bloated agricultural and industrial sectors for decades. Then Germany wised up and decided to improve the deal getting cheap labor and large markets with the successive enlargements. Can't blame them at all for doing it.
The only way it could have ever worked out would have been without all those billions and billions of subsidies, letting every country compete and get better. But it was never about it.