Heat oil in a large Dutch oven or other heavy pot over medium. Add onion and garlic and cook, stirring often, until softened but not browned, about 5 minutes. Add tomato paste and red pepper flakes and cook, stirring, until paste is slightly darkened in color (it should start to fry in the oil), about 1 minute. Add tomato purée, salt, and sugar, and bring to a simmer. Partially cover pot with a lid (to avoid splattering), reduce heat so sauce is at a very bare simmer, and cook, stirring occasionally, until slightly thickened, 40–50 minutes.
Do ahead: Sauce can be made 2 days ahead. Let cool. Transfer to an airtight container; cover and chill.