Wash and finely chop the spinach. Keep aside. Wet grind the coconut, red chillies, cummin seeds and black gram to a fine paste. Keep aside. Pressure-cook the dal with salt and turmeric. When cool blend in a liquidizer. Keep aside.
Heat the oil and season with mustard seeds, curry leaves and asafoetida. When the mustard starts to crackle add the coconut paste and fry for 3-4 minutes. Add the onions and spinach and stir-fry till the spinach is cooked.
Add the dal. Mix well and simmer on low heat for another 10 minutes. Serve hot.