Place the pancetta, the onion, carrot, and celery in a food processor and process until finely chopped.
Heat the oil in a medium skillet over medium heat, then add the vegetable mixture. Cook, stirring, for about five minutes.
Add the wine and the tomato paste.
Mix well to combine and add the tomatoes, their juice, and the basil leaves, torn into bits. Break up the tomatoes using the back of a cooking spoon, and cover. Cook for about a half hour, stirring from time to time. Season with salt and pepper to taste.
Bring a large pot of water to a boil and add 2 tablespoons of salt. Cook the spaghetti according to package directions, then drain, reserving about 1/2 cup of the cooking water.
Add the pasta to the pan with the sauce in it.
Add the ricotta cheese and the parsley and toss while cooking over high heat for about 30 seconds.
Add the cooking water if it's necessary to thin somewhat. Check for seasoning and serve.