Preheat the oven to 375℉ Spray the inside of a 9x13-inch casserole dish with nonstick spray.
Cook the spaghetti noodles to al dente according to the package directions. Rinse, drain, and set aside.
Heat a 5-quart-pot (or a large, very deep skillet) over medium-high heat. Add the beef, onion, and garlic, and cook until the meat is browned and the onion is softened, about 8 minutes. Stir occasionally with a wooden spoon to break up the meat.
Turn the heat down to medium. Add the cream cheese and stir until it’s fully combined. Turn off the heat.
Stir in the marinara sauce, sour cream, Italian herb seasoning, sugar, salt, and black pepper.
Add the cooked spaghetti noodles, 1 cup shredded mozzarella, and ½ cup grated parmesan, and stir to combine.
Transfer the mixture to the prepared casserole dish. Sprinkle on the remaining 1 cup mozzarella and ½ cup grated parmesan.
Bake uncovered until the cheese is melted and the casserole is warm throughout, about 20 minutes. If you want to brown the top, briefly broil the casserole after baking.