As far as there is not an international assignment from Switzerland to Spain, Social Security payments will be required in Spain.
To the extent that there is no Spanish Subsidiary/no PE in Spain, the Swiss Company must registered within the Spanish Social Security System to proceed with social tax payments.