Rinse the mung beans in a fine-mesh sieve under cold water for 30 seconds, until the water runs mostly clear. Dice the onion, mince the garlic, and grate the ginger.
Heat the avocado oil in a 4-quart / 3.8 L heavy-bottomed pot over medium heat. Add the onion with a pinch of the salt and cook for 5 minutes, stirring, until soft and golden at the edges. Stir in the garlic, ginger, cumin, coriander, turmeric, garam masala, and chili flakes. Cook for 1 minute until fragrant.
Add the rinsed beans, the water, and the remaining salt. Bring to a boil, then drop the heat to a gentle simmer. Cover with the lid slightly ajar and cook for 35 minutes, stirring every 10 minutes, until the beans are tender and a few have split. If the pot looks dry, add 120 ml / 1/2 cup of water.
Stir in the diced tomatoes and coconut milk. Simmer uncovered for 7 minutes, until the sauce thickens slightly and coats the back of a spoon.
Add the spinach by the handful, stirring for 2 minutes until wilted and bright green. Stir in the lemon juice and taste for salt. Serve hot, topped with the cilantro.