Right, this is a bit of medical advice derived from personal experience. I had seen it recommended previously. Some years ago we went to Lanzarote for a week's holiday. The weather was awful when we arrived - gales and pouring rain. After 2 days it cleared and we were desperate to have a dip in the sea. Went to a beach at Papapgayo where I plunged in and swam out to the rock in the middle of the bay. I forgot to wear wet suit boottees as I normally do in these places. I turned for shore and kicked out on the rock. Unfortunately there were several Diadema urchins occupying the space my feet hit. It hurt a bit! As I swam back I had time to contemplate how I was going to handle this and I remembered that during preparations for a talk I gave years before at the RGS, a medical textbook had advised a particular strategy. Angie (my wife) was rather surprised to see me emerge from the water yelling then proceeding to beat the soles of both feet with a flattened pebble. That hurt too. After a session of self flagellation I limped back to her, got dressed, hobbled back to the hire car and we returned to Puerto del Carmen. Here I liberally applied Betadine paint to the soles of my feet, we went out to eat (and consume plenty of alcohol on my part). By the next morning I was walking normally and virtually pain free. There were about 30 spines in my feet and the black specks took weeks to disappear but gave me no problem.
Henceforth my advice has been that when spiked by an urchin, pummel the affected area until the spikes are well fragmented allowing the body to digest them. Applying iodine at the time is probably worthwhile as well.
I don't think it works with plugs or cat poo by the way.