I think it could work as long as there is enough substance in the companies and there is no business activity from Spain.
In the long run, I think it would be best to run the business directly from Spain. With a spanish SL the first two years you will have only 15% CIT, (even 4 years under the...