Bring a large pot of salted water to a boil. Cook the spaghetti until just al dente, then reserve ¼ cup of pasta water before draining.
In a large skillet over medium heat, heat the olive oil. Add the ground beef and cook until browned, breaking it up with a spatula. Add the onion and cook for 3 minutes, then stir in the garlic and cook for 30 seconds.
Pour in the marinara sauce, oregano, salt, black pepper, and sugar. Stir to combine, then simmer for 10 minutes.
In a large bowl, whisk together the cream cheese, sour cream, Parmesan, garlic powder, salt, and black pepper until smooth. Stir in the reserved pasta water, then toss with the cooked spaghetti until evenly coated.
Preheat oven to 375°F (190°C). Lightly grease a 9x13-inch (23x33 cm) baking dish. Spread half of the meat sauce on the bottom of the dish. Layer all of the spaghetti mixture on top, then spread the remaining meat sauce over it. Sprinkle with mozzarella and Parmesan cheese.
Cover with foil and bake for 20 minutes. Remove the foil and bake for another 10-15 minutes, or until the cheese is bubbly and golden brown.
Let the dish rest for 5 minutes before slicing. Garnish with fresh parsley if desired and serve with garlic bread or a side salad.