Heat 2 tablespoons olive oil in a large skillet or Dutch oven over medium-high heat until shimmering. Add 1 pound ground beef and cook, breaking it into small crumbles with a wooden spoon or potato masher, until browned and no longer pink, about 5 to 7 minutes. Don't stir constantly. Let the meat sit and develop some color before breaking it up.
Push the meat to one side of the pan. Add 1 diced medium yellow onion to the cleared space and cook, stirring occasionally, until softened and translucent, about 3 to 4 minutes. Add 4 cloves minced garlic and cook until fragrant, about 30 seconds. Stir everything together.
Stir in 1 (6-ounce) can tomato paste and cook, stirring frequently, until the paste darkens slightly and becomes fragrant, about 1 to 2 minutes. This step builds flavor by caramelizing the tomato paste.
Add 1 (28-ounce) can crushed tomatoes, 1/2 cup water or beef broth, 1 teaspoon dried oregano, 1 teaspoon dried basil, 1/2 teaspoon sugar (if using), 1 teaspoon kosher salt, 1/4 teaspoon black pepper, and 1/4 teaspoon red pepper flakes (if using). Stir to combine.
Bring the sauce to a simmer, then reduce heat to low. Cover and simmer for 20 to 25 minutes, stirring occasionally. For a thicker sauce, leave the lid slightly ajar or remove it entirely for the last 10 minutes.
While the sauce simmers, cook 12 ounces spaghetti according to package directions in well-salted water. Reserve 1/2 cup pasta water before draining.
Taste the sauce and adjust seasoning as needed. Add more salt, pepper, or a pinch more sugar if the sauce tastes too acidic.
Toss the drained pasta with the meat sauce, adding a splash of reserved pasta water if needed to loosen. Serve topped with freshly grated Parmesan cheese and fresh basil leaves if desired.