Preheat the oven to 375°F (190°C) and grease a casserole dish with olive oil or cooking spray.
In a large skillet, heat 2 tablespoons of olive oil over medium heat. Add the onion and cook until translucent, about 2-3 minutes. Stir in the minced garlic and sliced mushrooms. Cook until the mushrooms are tender and browned, about 5-6 minutes.
Add the chopped spinach to the skillet and cook for an additional 2-3 minutes, or until the spinach wilts. Season with salt, black pepper, and dried oregano. Remove from heat.
In a large mixing bowl, combine well the cooked spaghetti squash flesh, ricotta cheese and half of the mozzarella cheese.
Spread half of the spaghetti squash mixture evenly into the greased casserole dish. Layer the sautéed mushroom and spinach mixture on top. Finish by spreading the remaining spaghetti squash mixture over the vegetables.
Sprinkle the remaining mozzarella cheese over the top of the casserole.
Cover the casserole dish with aluminum foil and place it in the preheated oven. Bake for 20-25 minutes, then remove the foil and bake for an additional 10-15 minutes, or until the top is golden and bubbly.
Allow the casserole to cool slightly before serving. Garnish with fresh basil leaves and serve.
