Why does millipede taste spicy? What is that 'spicy substance'?

I have no idea if you are correct, nor whether a dish of millipedes might contain added spices. If we assume you are correct then it will most likely contain a compound similar to capcaisin which is the active ingredient in chili pepper.