Cook the pasta. Bring a large pot of salted water to a boil. Cook spaghetti until just al dente. Reserve 1/2 cup pasta water, then drain.
Sauté aromatics. Heat olive oil in a large skillet or pot over medium heat. Add onion (and carrot if using) and cook 5 to 6 minutes until softened. Add garlic and cook 30 seconds.
Brown the beef. Add ground beef, salt, and pepper. Cook 6 to 8 minutes, breaking it up, until browned. Drain excess fat if needed.
Build flavor. Stir in Italian seasoning and tomato paste. Cook 1 minute, stirring constantly.
Simmer. Add broth, crushed tomatoes, tomato sauce, sugar (if using), bay leaf, and red pepper flakes (if using). Bring to a gentle simmer, then reduce heat to low and simmer uncovered 20 to 25 minutes, stirring occasionally.
Finish. Remove bay leaf. Stir in Parmesan. Taste and adjust salt and pepper.
Toss and serve. Toss spaghetti with the sauce (add a splash of reserved pasta water if needed). Serve with extra Parmesan and herbs.