Rinse the lentils and rice separately under cold water until the water runs clear; drain well.
Peel the onions, halve them root to tip, and slice thinly.
Heat the olive oil in a wide, heavy pot over medium heat. Add the onions and cook, stirring every few minutes, until deep golden brown with some crisped edges, 20–30 minutes. Transfer about half to a paper towel–lined plate for topping; leave the remainder and the oil in the pot.
Stir in the ground cumin and ground allspice and cook until fragrant, about 30 seconds.
Add the lentils and the water, bring to a boil, then cover, reduce heat to medium-low, and simmer until the lentils are slightly tender but still firm in the center, 10–12 minutes.
Stir in the rice, kosher salt, and black pepper. Return to a gentle simmer, cover, and cook over low heat until the rice is tender and the liquid is absorbed, 15–20 minutes. If you hear vigorous bubbling, lower the heat; if the pot looks dry before the grains are tender, sprinkle in a few tablespoons of hot water.
Remove from the heat and let rest, covered, for 10 minutes. Fluff gently with a fork.
Spoon onto a platter, top with the reserved crispy slices, and serve warm with plain yogurt and lemon wedges.