Bring a large pot of salted water to a boil. Add the pasta and cook as the label directs. Reserve 3/4 cup cooking water, then drain.
Meanwhile, heat the olive oil in a large skillet over medium heat. Add the pancetta and red onion and cook, stirring occasionally, until the onion is tender, about 10 minutes. Add the garlic and red pepper flakes; cook until the garlic is just softened, about 1 minute. Stir in the tomatoes, basil and 1/4 teaspoon salt. Gently simmer, stirring occasionally, until the sauce is slightly thickened, about 10 minutes.
Add the pasta to the sauce and toss to coat, gradually adding the reserved cooking water as needed to loosen; discard the basil. Add the parmesan, season with salt and toss again. Top each serving of pasta with more parmesan and red pepper flakes.