Someone once said that the only things you cannot avoid are death and taxes.
While the first part of that statement is true even in Spain a large number of aliens do quite well in avoiding the taxes.
A number of aliens living and working in Spain do not pay taxes, but the Spanish authorities are aware of it, and before long tax avoidance will be much more difficult.