Cook the pasta in salted water according to the packet instructions (al dente is best).
While the pasta is cooking make the sauce. Heat up the oil and fry the onion and garlic for a couple of minutes over a low heat, stirring often, until softened. Add the spinach, stir, season and cook over a medium-high heat for about a minute, until the spinach has reduced in volume (stirring all the time). Remove from the heat before the mixture becomes watery. Puree until the mixture is silky smooth. Set aside.
In a saucepan melt the butter over a low heat, add the flour and quickly whisk until a paste forms. Increase the heat and gradually add the milk whisking all the time until the sauce thickens and starts bubbling up. Remove from the heat and set aside for 2 minutes to allow the sauce to thicken further.
Add the spinach mixture, cheese and stir thoroughly until the sauce is smooth and glossy. Add the pasta, season to taste, stir and serve.
Do not cook the spinach, only heat it to reduce in volume. If it starts to release water just puree it along with the spinach and onion mixture.
I recommend using baby spinach if possible as it's tastier than mature spinach.
If you've cooked the pasta ahead and it's cooled by the time you've made the sauce you can reheat the pasta in the microwave before combining with the sauce.
Best served immediately.
You can freeze the sauce in an airtight container, without the pasta.