Boil the spinach for 10 minutes in a very small amount of lightly salted water. Drain, squeeze out all excess liquid, and purée in a food processor. Sauté the puréed spinach in a skillet with the chopped shallots and olive oil until dry and the shallots have softened; remove from heat and let cool.
In a small saucepan, heat three tablespoons of olive oil and stir in two tablespoons of flour. Mix well, then whisk in the milk, a pinch of salt, black pepper, and the nutmeg. Cook over low heat, stirring continuously, until the béchamel thickens.
Add the béchamel sauce, eggs, and grated Parmigiano Reggiano to the cooled spinach mixture. Stir well until all ingredients are thoroughly combined.
Transfer the mixture to a rectangular baking dish. Bake in an oven preheated to 180°C (350°F) for about 30 minutes, until the flan is set and golden-brown on top.
Garnish with fresh basil leaves and serve immediately.