Heat a large saucepan over a medium heat and add the olive oil. Add the pancetta or bacon and cook for a couple of minutes until it starts to release its fat and turn lightly golden. Add the onion with a pinch of salt and cook gently for a few minutes until softened, then add the celery and cook for another couple of minutes.
Stir in the carrots and garlic and cook for another 2 minutes, stirring so everything cooks evenly. Increase the heat slightly, add the beef mince, and break it up well. Cook until the mince is browned all over and any excess liquid has evaporated.
Stir in the tomato purée and cook it out for a minute or two, then add the chopped tomatoes and stock. Stir well, bring to a gentle simmer, then turn the heat down and let it bubble away gently for about 45 minutes, stirring occasionally, until the sauce is thick and rich. Season with salt and pepper to taste.
About 10 minutes before the end of cooking, stir in the drained lentils and allow them to heat through.
When the sauce is nearly ready, cook the spaghetti in a large pan of well-salted boiling water according to the packet instructions. Drain, add the pasta to the sauce, toss well, and serve.