Preheat the oven: Preheat the oven to 425°F (220°C).
Prepare the tomatoes and garlic: Wash the tomatoes and cut each one into four pieces. Arrange them in a large baking dish. Leave the garlic cloves inside their skins, but carefully trim off the hard top ends.
Add the seasonings: Drizzle the tomatoes and garlic with olive oil. Sprinkle with dried oregano, salt, and black pepper, then add the fresh basil. Toss gently to distribute the oil and seasonings evenly.
Roast the tomatoes: Roast for approximately 30 minutes, stirring occasionally, until the tomatoes are very soft and juicy and the garlic is tender.
Cook the spaghetti: While the tomatoes are roasting, bring a large pot of salted water to a boil. Cook the spaghetti according to the package instructions until al dente. Drain well and set aside.
Peel the tomatoes and garlic: Remove the baking dish from the oven. Carefully peel away the loosened tomato skins. Squeeze the soft roasted garlic cloves from their skins.
Blend the sauce: Transfer the peeled tomatoes, garlic, basil, and all the juices from the baking dish to a deep container. Blend with an immersion blender until smooth and creamy.
Simmer the sauce: Pour the blended sauce into a large saucepan or skillet. Bring it to a gentle boil over medium heat. Taste and add more salt or black pepper if necessary.
Combine with the spaghetti: Add the cooked spaghetti to the sauce and toss until every strand is evenly coated. Heat briefly until everything is warmed through.
Serve: Divide the Roasted Tomato Pasta among four plates. Serve warm with grated Parmesan, toasted pine nuts, fresh basil, or leafy greens, if desired.