Place a large pot of salted water over high heat. You'll be using this to cook the pasta, but don't add your pasta just yet. If the water comes to a boil before you're ready for it, simply reduce the heat and keep it barely simmering.
Coat the bottom of a large pot with the olive oil and place it over medium heat. Give the oil a minute to heat up. Once it starts to shimmer, add the onion. Cook the onion for about 5 minutes, stirring occasionally, until it becomes soft and translucent.
Add the garlic and red pepper flakes. Cook the mixture for about 1 minute, stirring constantly, until the garlic becomes very fragrant.
Stir in the wine. Raise the heat just enough to bring the wine to a boil, then lower the heat and let it simmer for 3 to 4 minutes, until most of it has cooked off.
Stir in the crushed and diced tomatoes. Bring the sauce to a boil, lower the heat, and let it simmer for about 15 minutes, until thickened slightly.
When the sauce has five to ten minutes left to cook, bring your pasta water back to a rolling boil if you reduced the heat, then add the pasta. Cook it according to the package directions. Drain it into a colander when done, reserving about a half cup of the pasta cooking water.
When the sauce has finished simmering, stir in the sugar and season it with salt to taste. Add the truffle oil, starting with just one tablespoon and adding more to taste. Stir in the basil.
Add the pasta to the pot containing the sauce. Thin it with some of the pasta cooking water only if needed.
Divide onto plates and serve.