Cook lasagna noodles according to package directions if using regular noodles. Drain and set aside; no-boil noodles can be used directly.
Heat olive oil or butter in a large skillet over medium heat. Cook chopped onion until softened.
Add minced garlic and cook until fragrant.
Add sliced mushrooms and cook until they release moisture and begin to brown.
Stir in fresh spinach and cook until wilted. Season vegetables with salt and pepper; remove from heat.
In a saucepan, melt butter over medium heat. Whisk in flour and cook for about 1 minute.
Gradually whisk in milk, stirring constantly until sauce thickens and is smooth.
Season the white sauce with salt, pepper, and optional nutmeg.
Preheat oven to 350°F (180°C).
Spread a thin layer of white sauce on the bottom of the baking dish.
Layer noodles over sauce, then add sautéed vegetables, ricotta (if using), mozzarella, and Parmesan cheese.
Repeat layers, finishing with sauce and a generous cheese topping.
Cover the dish with foil and bake for 25 to 30 minutes.
Remove foil and bake for another 10 to 15 minutes until cheese is golden and bubbly.
Let lasagna rest for 5 to 10 minutes before slicing and serving warm.