It might be a problem to keep your best developers working in Barcelona on Spanish level salaries if they are good, young and fluent in English. It's not just the absolute salary numbers: the relative purchasing power of even decent Spanish salaries is pitiful.
I only stay here because I'm not so young anymore and have a family, but otherwise I would move somewhere that might be twice as expensive but pay more like 3x.