Except the Maldives don't want a blanket ban and neither does their population.
Thirteen countries have NOT joined South Africa's ICJ case either. Only "Nicaragua, Colombia, Mexico, Libya and Palestine have filed formal requests and are waiting for the International Court of Justice in The Hague, Netherlands, to grant approval to join the case."
The rest?
"Others have taken a political stance by announcing their intention to join the case in support of South Africa, such as Belgium, Türkiye, Egypt, Maldives, Ireland, Chile and now Spain. But their declarations of interventions still have to be filed with the ICJ."
Haven't joined. Important to be clear and accurate.
Spain has told their ministers to stop calling it "genocide" as it means they have international law obligations to take in Gazans as refugees. And their consulate staff don't want to relocate to Ramallah either.
There's a lot of politics going on.