Finely dice the onion to about 1/4 inch (6 mm) and set aside. Mince the garlic and keep it in a separate pile, since it goes in much later.
Pour the canned tomatoes with their juices into a large bowl and crush each tomato by hand until no piece is bigger than a walnut, discarding any hard core or stem end. Tear the basil and set aside for the end.
Set a 3 to 4 quart saucepan or Dutch oven over medium heat, add the olive oil, and heat about 1 minute until it shimmers. Add the onion and 1/4 teaspoon of the salt, stir to coat, and cook 6 to 8 minutes until soft and translucent with no brown edges.
Push the onion to one side, add the tomato paste to the cleared space, and cook about 1 minute, stirring into the oil, until it darkens to a deeper brick color. Stir the paste into the onion, then add the garlic and red pepper flakes if using, and cook just 30 seconds, stirring constantly, until you smell the garlic.
Pour in the crushed tomatoes and all their juices, scraping the bottom of the pot with a wooden spoon to lift any browned bits. Add the bay leaf, oregano rubbed between your fingers, the remaining 1/4 teaspoon salt, and the black pepper, then stir well and bring to a gentle boil over medium-high heat.
Reduce the heat to low so the sauce bubbles lazily, and simmer uncovered for 25 minutes, stirring every 5 minutes and scraping the bottom each time. The sauce is done when it mounds on a spoon, a spoon dragged across the bottom leaves a clear trail, and a thin sheen of oil shows at the edges.
Turn off the heat, remove the bay leaf, and stir in the torn basil. Taste and add salt a pinch at a time until the tomato flavor tastes bright; if it tastes sharp, stir in the sugar and simmer 1 more minute. Blend 10 to 15 seconds for a smooth sauce, or leave chunky.
Serve warm over pasta or in any recipe that calls for marinara. To store, cool at room temperature for no more than 30 minutes, transfer to airtight containers, and refrigerate within 2 hours of cooking.