In a large saucepan over medium-low heat, add the olive oil, smashed garlic and crushed red pepper flakes.
Gently cook, stirring occasionally, until the oil is fragrant and the garlic and crushed red pepper flakes are lightly toasted, about 10 minutes.
Increase the heat to medium, add the finely diced red onion and garlic, and cook until softened, about 5 minutes.
Add the tomatoes, breaking them apart into large chunks with a flat wooden spoon, and season with the salt. Bring to a simmer and cook, covered, until a loose sauce forms, 12 minutes.
While the sauce is cooking, bring a large pot of salted water to a boil. Add the penne to the water and cook until al dente, 7 to 8 minutes. Reserve ¼ cup of the pasta water. Drain the pasta and return to the pot with the reserved water.
Add the arrabiata sauce to the pasta and cook until slightly thickened, 2 to 4 minutes.
Stir in the basil leaves, then taste and adjust the seasoning with salt.