Rinse the lentils well under cool water until the water runs mostly clear.
Heat olive oil in a large pot over medium heat. Add onion and cook for 4 to 5 minutes until softened.
Add garlic, ginger, tomatoes, cumin, coriander, turmeric, and chili powder. Cook for 2 to 3 minutes until fragrant and the tomatoes begin to soften.
Add the lentils, water or broth, and salt. Bring to a boil, then reduce heat and simmer for 20 to 25 minutes, until the lentils are tender and creamy.
Stir in the spinach and cook for 2 to 3 minutes until wilted. Add lemon juice and cilantro, then adjust the seasoning to taste.
For the tempering, heat ghee or oil in a small skillet. Add cumin seeds and mustard seeds and let them sizzle for a few seconds.
Add sliced garlic, dried chilies, and red pepper flakes. Cook briefly until the garlic is lightly golden and fragrant.
Pour the hot tempering over the dal and gently stir it through.
Serve warm with basmati rice, roti, or naan.