Preheat your oven to 350°F (175°C) and lightly grease a 9x13-inch casserole dish with olive oil.
In a medium saucepan, heat 1 tablespoon of olive oil over medium heat. Add the chopped spinach and sauté for 3-4 minutes, until wilted. Remove from heat and let it cool slightly.
In a large mixing bowl, combine the ricotta cheese, eggs, milk, garlic powder, onion powder, salt, black pepper, and red pepper flakes (if using). Whisk together until smooth and creamy.
Fold in the sautéed spinach and sweet corn into the ricotta mixture. Then, gently stir in half of the mozzarella and Parmesan cheeses, reserving the rest for topping.
Pour the mixture into the prepared casserole dish, spreading it evenly. Sprinkle the remaining mozzarella and Parmesan cheese over the top, followed by the breadcrumbs for added crunch.
Place the casserole in the oven and bake for 30-35 minutes, or until the top is golden brown and bubbling.
Remove from the oven and let it cool for about 10 minutes before slicing. Serve warm as a delicious side dish or as a main course.