Heat 2 tbsp. oil over medium heat in a large nonstick frying pan. Add onions and a pinch of salt and cook, stirring occasionally, until browned and very soft with crisp edges, about 30 minutes. Transfer half to a bowl and set aside.
Meanwhile, put lentils in a saucepan with 3 cups water and the bay leaves. Bring to a simmer over medium heat, uncovered, and skim foam. Simmer just until tender, 5 to 10 minutes (they'll fall apart a little). Remove bay leaves and set lentils aside-don't drain.
Stir chile, ginger, coriander, turmeric, and 1 tsp. salt into pan of onions and cook over medium heat until fragrant, about 1 minute. Add spinach and cook, stirring occasionally, until completely wilted, about 3 minutes. Stir onion-spinach mixture into pot of lentils and wipe frying pan clean.
Heat 1 tbsp. oil in pan over medium heat. Add cumin and garlic and cook, stirring, until seeds are sizzling, about 1 minute; stir into lentils. Season with salt. Top lentils with reserved onion and serve over rice.