Heat the butter in a saucepan, add the flour and cook for 2 minutes. Remove from the heat and whisk in the milk. Bring almost to the boil, reduce the heat and then simmer for 4 minutes. Season with the freshly ground nutmeg.
Preheat the oven to 200˚C / fan 180˚C / gas 6. Meanwhile, place the spinach in a large saucepan and add a splash of water. Cook over a medium-high heat for 2-3 minutes until wilted. You may need to do this in batches. Tip into a colander to drain and, when cool enough to handle, squeeze out all the excess moisture and roughly chop.
Place the pine nuts in a medium saucepan and carefully toast over a low heat. Set to one side. In the same pan, heat the oil, add the onion and gently cook for 5 minutes until softened. Add the garlic and cook for a further 2 minutes. Place the spinach in a bowl, add the onion mixture, ricotta and half the parmesan. Season with black pepper and combine well.
To assemble, place a third of the courgettes in the base of a 2 litre baking dish. Add a third of the white sauce and half of the spinach mixture. Scatter with pine nuts and add another third of courgettes. Add another third of white sauce and the remaining spinach mixture. Scatter with the remaining pine nuts and use the remainder of the courgette. Finally add the remainder of the white sauce and finish with a scattering of parmesan. Bake for 45 minutes until golden and bubbling.