Preheat the oven to 375°F and lightly grease a 9x13-inch baking dish.
Heat the olive oil in a large saucepan over medium heat. Add the onion, zucchini, and carrots and cook for 7–8 minutes, until softened. Add the garlic and cook 1 minute.
Stir in the marinara, spinach, and Italian seasoning. Simmer for 10 minutes, until the vegetables are very tender.
Carefully blend the sauce until smooth using an immersion blender (or in batches in a regular blender with the lid vented). Season with salt and pepper.
Meanwhile, cook the pasta in salted boiling water for 2 minutes less than the package directions. Drain.
In a bowl, mix the ricotta, egg, and ¼ cup of the Parmesan.
Toss the pasta with about two-thirds of the sauce. Spread half the pasta in the baking dish, dollop the ricotta mixture over it, then top with the remaining pasta and sauce.
Sprinkle with mozzarella and the remaining Parmesan. Cover with foil and bake for 20 minutes, then uncover and bake 10–15 minutes more, until bubbly and golden.
Let rest for 10 minutes, garnish with basil, and serve.