In a large pot or Dutch oven, heat the oil over medium-high. Add the onion and garlic, season with salt and pepper, and cook, stirring occasionally, until golden brown and tender, 5 to 7 minutes. Add 5 cups of water, the lentils and the thyme and bay leaves (if using). Partially cover, bring to a boil, then reduce heat and simmer, partially covered, until the lentils are al dente, 25 to 30 minutes.
Add the tomatoes and 1 teaspoon salt, and bring to a boil over high. Add the pasta and cook, stirring often to keep the pasta from sticking to the pot, until the pasta is al dente, 10 to 20 minutes. (It may take longer than the cook time on the package.) If the pot starts to look dry at any point, add more water, ¼ cup at a time.
Turn off the heat, discard the thyme and bay leaves, and stir in the Parmesan. Serve immediately with additional olive oil and Parmesan, if desired.