Heat the olive oil in a 12-inch heavy skillet over moderate heat until hot but not smoking.
Add the thinly sliced onions, chopped garlic, 1/4 teaspoon salt, 1/8 teaspoon black pepper, and the bay leaf; reduce heat to moderately low, cover, and cook, stirring occasionally, until the onions are very tender and golden, 20 to 25 minutes.
Remove and discard the bay leaf from the onions and keep the skillet warm off the heat.
Meanwhile, place the lentils in a 1½- to 2-quart saucepan and cover with water by about 1 inch. Bring to a boil over moderate heat, cover, and cook until just tender and most of the water is absorbed, 15 to 20 minutes; season to taste with salt and pepper and keep covered until ready to use.
Cook the pasta in a 6- to 8-quart pot of boiling salted water until al dente. Reserve 1 cup of the cooking water, then drain the pasta and return it to the pot.
Add the cooked onions, drained lentils, and baby spinach to the pasta. Toss, adding just enough reserved pasta cooking water to wilt the spinach and moisten the pasta.
Stir in the finely grated Parmigiano-Reggiano and adjust seasoning with salt and pepper to taste, tossing until combined; serve immediately.