It's not like it was paid only by people from outside Catalonia. In fact, the catalan people, pay taxes as well, and that money was used to fund developments outside Catalonia too. And this not only happens at a country level, there are for example funds from the European Union like the ERDF. Does that mean that Scotland should never leave the UK (and therefore the EU) because their roads -for example- have been paid by the european people for many, many years?
https://en.wikipedia.org/wiki/European_Regional_Development_...