Cook the spaghetti according to package instructions. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and cook for 1-2 minutes, until fragrant.
Add the chopped tomatoes and red pepper flakes to the skillet. Cook for 10 minutes, until the tomatoes start to break down and release their juices.
Add the cooked spaghetti to the skillet and toss to combine with the tomato mixture. Cook for an additional 2 minutes, until heated through.
Stir in the chopped fresh basil. Season with salt and black pepper to taste.
Serve the pasta with grated Parmesan cheese on top.