Bring a large pot of salted water to a rolling boil.
Cook spaghetti until al dente. Reserve 1/2 cup pasta water, then drain.
Heat olive oil in a wide skillet over medium heat. Stir in garlic and red pepper flakes; cook until fragrant, about 30 seconds.
Add cherry tomatoes, salt, and black pepper. Cook, stirring, until blistered and starting to burst, 6–8 minutes. Lightly smash some to release juices.
Stir in butter and a splash of reserved pasta water. Simmer 1–2 minutes until glossy and slightly thickened.
Toss in drained pasta. Add Parmesan and half the basil. Loosen with more pasta water as needed so the sauce coats the noodles.
Finish with lemon juice. Taste and adjust salt. Top with remaining basil and extra Parmesan to serve.