Bring a pan of water to the boil. Add the pasta and cook for 8-12 minutes (depending on the variety), then drain and keep warm.
Meanwhile finely slice the onion. Heat the oil in a pan and gently soften the onion for about 5 minutes. Add the garlic and the chilli (if used), cook for a minute, then add the sugar. Cook for another 3-5 minutes.
Rinse the spinach under cold water, drain, then add to the pan. Put a lid on and cook for a couple of minutes until it's wilted, then turn off the heat.
Stir through the pasta, then crumble the cheese on top.
Season to taste and toss well. Squeeze a drop of lemon juice over it, if you like.
Serve warm.