01 - Preheat the oven to 375°F. Grease a 9x13-inch baking dish with butter or non-stick spray.
02 - In a skillet, heat olive oil over medium heat. Add the chopped onion and cook until softened, about 5 minutes. Add garlic and spinach if using, and cook for an additional 2 minutes. Remove from heat and set aside.
03 - In a saucepan, melt unsalted butter over medium heat. Whisk in all-purpose flour and cook for 1 minute to form a roux. Gradually whisk in whole milk until a smooth mixture forms. Simmer for 3 to 4 minutes until slightly thickened. Stir in pumpkin purée, nutmeg, sage, salt, and black pepper. Remove from heat once well combined.
04 - In a mixing bowl, combine ricotta cheese with the large egg and half of the grated Parmesan cheese, stirring until evenly incorporated.
05 - Spread a thin layer of pumpkin sauce on the bottom of the prepared baking dish. Arrange lasagna noodles in a single layer. Add half of the ricotta mixture, followed by half of the sautéed vegetables, one-third of the shredded mozzarella, and one-third of the remaining pumpkin sauce. Repeat the layers, finishing with noodles, remaining pumpkin sauce, mozzarella cheese, and the rest of the Parmesan.
06 - Cover the baking dish tightly with aluminum foil and bake for 30 minutes. Remove foil and bake an additional 15 to 20 minutes, or until the top is golden and the lasagna is bubbling around the edges.
07 - Allow the dish to rest for 10 minutes before slicing to help the layers set. Serve warm.