It is a violation of international law to return people to a place where they will be persecuted and tortured. Kazakh officials had an obligation to know the risk these men faced if returned, but sent them back anyway.
Shipping people back to Morocco is not an answer to this crisis. Protecting these extremely vulnerable people should be the Spanish government's priority.