Preheat your oven to 375°F (190°C). Bring a large pot of salted water to a boil. Add the ziti and cook for 2 minutes less than the package directions suggest for al dente; the pasta will finish cooking in the oven. In a separate medium pot, boil the rinsed lentils in 3 cups of water for about 15-20 minutes until tender but not mushy. Drain and set aside.
In a large skillet or Dutch oven, heat the olive oil over medium heat. Add the diced onion, carrot, and celery. Sauté for about 6-8 minutes until the vegetables are soft. Add the minced garlic and cook for another minute until fragrant.
Stir in the tomato paste, crushed tomatoes, Italian seasoning, red pepper flakes, and the cooked lentils. Season with salt and pepper. Let the sauce simmer on low heat for 10-15 minutes to allow the flavors to develop. If the sauce becomes too thick, add a splash of pasta water.
In a large mixing bowl, combine the cooked ziti with the ricotta cheese and half of the lentil bolognese sauce. Stir gently until the pasta is well coated with the creamy cheese and tomato mixture.
Spread a thin layer of the remaining bolognese sauce on the bottom of a 9×13 inch baking dish. Pour the pasta mixture into the dish. Top with the remaining sauce, then sprinkle evenly with shredded mozzarella and Parmesan cheese. Cover with foil and bake for 20 minutes. Remove the foil and bake for an additional 10-15 minutes until the cheese is bubbly and lightly browned.