Heat a large skillet over medium. Add the ground beef and cook, breaking it into small pieces, until browned, about 8–10 minutes; drain excess fat.
While the beef cooks, dissolve the beef bouillon cubes in the hot water (or use prepared beef broth) and pour into the skillet with the meat.
Add the tomato sauce, tomato paste, sugar, dried basil, dried oregano, garlic powder, and salt and pepper to taste. Stir until combined.
Bring the sauce to a low simmer, reduce heat, and cook gently for about 30 minutes, stirring occasionally.
Several minutes before the sauce is done, cook the spaghetti in a pot of boiling salted water according to package directions until al dente.
Drain the spaghetti and add it to the skillet with the sauce; toss to coat evenly.
Serve hot and top with grated Parmesan if desired.