Bring a large pot of salted water to a boil. Cook the spaghetti according to package directions until al dente. Reserve 1/2 cup pasta water, then drain.
Heat the olive oil in a large skillet over medium heat. Add the chopped onion and cook for 3–5 minutes until softened.
Add the garlic and cook for 30 seconds until fragrant.
Add the ground beef, break it into small pieces, and cook until thoroughly browned and no longer pink. Drain excess fat if needed.
Stir in the tomato paste and cook for one minute. Add the crushed tomatoes, Italian seasoning, salt, and black pepper. Add optional sugar if needed.
Reduce the heat and simmer the sauce uncovered for 15–25 minutes, stirring occasionally. Add a splash of pasta water if the sauce becomes too thick.
Toss the cooked spaghetti with the meat sauce, adding more pasta water as needed to coat the noodles.
Serve warm with grated Parmesan cheese and fresh parsley or basil.