Heat olive oil in a large pot over medium heat. Add diced carrots, celery, and onion. Cook, stirring occasionally, until the vegetables soften, about 6 minutes.
Stir in the chopped walnuts and cook for another 2 minutes until fragrant and lightly toasted.
Add tomato paste, minced garlic, Italian seasoning, red pepper flakes, black pepper, and salt. Cook for 1 minute until aromatic.
Pour in the red wine, scraping any browned bits from the bottom. Simmer for 2 minutes to slightly reduce.
Add lentils, vegetable broth, crushed tomatoes, and sugar. Stir to combine. Bring to a boil, then reduce heat and simmer uncovered for 35–45 minutes, or until the lentils are tender and the sauce has thickened. Stir occasionally. Cover the pot if it thickens too quickly.
Assemble and Bake:
While the sauce simmers, cook the spaghetti in a large pot of salted boiling water (about 1 tablespoon salt per 4 liters of water) until al dente according to package instructions. Drain and toss with 1 tablespoon olive oil to prevent sticking. Set aside.
In a medium bowl, mix together the vegan ricotta, plant milk, garlic powder, and nutritional yeast until smooth.
Preheat your oven to 375°F (190°C). Lightly grease a 9×13 inch (23×33 cm) baking dish.
Spread half the cooked spaghetti into the bottom of the dish.
Layer all of the ricotta mixture evenly over the noodles.
Pour half of the bolognese sauce over the ricotta layer.
Top with the remaining spaghetti, followed by the rest of the bolognese.
Sprinkle the shredded vegan mozzarella evenly across the top.
Cover the dish with foil and bake for 20 minutes. Then remove the foil and bake for an additional 10–15 minutes, or until the cheese is melted and bubbly.
Let rest for 10 minutes before slicing and serving.
Notes
Refrigerator: You can refrigerate this casserole before or after baking. Either way, it will last 3 to 4 days in the refrigerator.
Freezer: This million dollar spaghetti recipe can also be frozen for up to 3 months before or after baking. Wrap it tightly in the baking dish or transfer leftovers to an airtight container; thaw in the fridge before reheating.
To reheat: Reheat individual portions in the microwave or cover with foil and warm in a 350ºF oven. If you stored the casserole before cooking, you can follow the original baking instructions.