Heat your oven to 200°C/Fan 180°C/Gas 6. Roughly chop the tomatoes and place them in a baking dish. Drizzle over 2 tsp olive oil and season with salt and pepper. Drop in 1 unpeeled garlic clove. Bake for 30 mins till the tomatoes are very soft and collapsing.
While the tomatoes roast, coarsely grate the courgette. Put it in a sieve with a pinch of salt. Squeeze the courgette a few times to squeeze out any water, then leave in the sieve to drain while you prepare the rest of the polpette ingredients.
Drain and rinse the lentils. Shake them dry. Tip into a large bowl and mash with a fork or masher. Peel and grate the remaining garlic clove into the bowl. Shred the mint leaves and add those, too. Halve the chilli, flick out the seeds and finely chop it. Add half to the bowl. Add 1 tbsp of the ricotta. Grate in the lemon zest.
Squeeze the courgette again to get out any remaining liquid. Add to the bowl along with the breadcrumbs and some salt and pepper. Mix together to make a stiff mixture. Shape into 10 ping pong-sized balls.
Line a baking tray with baking paper. Spread the polpette out on the tray. Bake on a shelf below the tomatoes for 10 mins. Remove from the oven and turn them over. Scatter the pine nuts onto the tray and bake for another 10 mins.
While the polpette bake, bring a large pan of water to the boil. When the polpette and tomatoes have 10 mins left to cook, add the spaghetti to the pan. Simmer for 8 mins till it’s cooked but not too soft. Drain. Pop on a lid to keep warm. Meanwhile, roughly chop the parsley leaves.
Take the tomatoes out of the oven. Remove the garlic clove and squeeze it out of its skin. Return to the dish. Chop in the butter. Mash the tomatoes, garlic and butter together to make a chunky sauce. Taste and season if needed. Toss the spaghetti with the sauce.
Pile onto plates and top with the polpette and 1 tbsp ricotta each. Garnish with chopped parsley leaves, toasted pine nuts and serve with wedges of the zested lemon.