Roast the garlic: Preheat the oven to 400°F (200°C).
Slice the tops off the garlic heads to expose the cloves. Place each head on foil, drizzle with olive oil, and wrap tightly. Roast for 35–45 minutes until the cloves are soft and golden.
Let cool, then squeeze the roasted garlic out of the skins.
Sauté the aromatics: In a large pot, warm 2 tablespoons of olive oil over medium heat. Add the diced onion and a pinch of salt. Cook 6–8 minutes until soft and translucent.
Stir in red pepper flakes and cook 30 seconds.
Add tomato paste and wine: Stir in the tomato paste and cook for 1 minute to caramelize slightly. Pour in the red wine, scraping the bottom of the pot. Simmer 2–3 minutes until reduced by about half.
Build the sauce: Add crushed tomatoes, roasted garlic (mash it with a fork first), oregano, dried basil, bay leaf, 1 teaspoon salt, and a few grinds of pepper.
Stir well.
Simmer low and slow: Bring to a gentle simmer. Reduce heat to low and cook uncovered for 25–35 minutes, stirring occasionally, until thickened and glossy. Taste and adjust salt and pepper as needed.
Balance the acidity: Stir in balsamic vinegar (or sugar) to round out the flavors.
Start small, taste, and add more if needed.
Finish and serve: Remove the bay leaf. If using fresh basil or parsley, stir it in now. For a smoother texture, blend part or all of the sauce with an immersion blender.
Serve over hot pasta or use as desired.