In a large skillet, heat the olive oil, over medium heat, and sauté the pancetta until brown and crispy. Remove with a slotted spoon and reserve.
Add the onions and garlic to the pancetta fat and sauté until translucent, about 2 minutes. Add the pancetta back to the skillet (reserving a little bit for garnishing at the end), the red pepper flakes and the white wine. Cook until the white wine is almost all absorbed, about 5 minutes.
Add the marinara sauce and once it boils, reduce the heat and simmer for about 15 minutes or until rich and thick.
While the sauce is simmering, cook the spaghetti according to package instructions, reserving a cup of the starchy pasta water to use if necessary.
Once sauce is thick, season with salt and pepper to taste.
Toss the pasta with the spaghetti (using the pasta water if necessary) and garnish with fresh basil and the reserved pancetta.
Serve immediately, with some more Parmigiano-Reggiano on the side!