01 - Preheat oven to 350°F (180°C). Grease a 9x13 inch baking dish with cooking spray or butter.
02 - Bring a large pot of salted water to a boil. Cook spaghetti according to package instructions until al dente. Drain well and set aside.
03 - In a large skillet over medium heat, cook ground beef with chopped onion until beef is browned and onion is soft, about 6 to 8 minutes. Drain excess fat.
04 - Add minced garlic to the skillet and cook for 1 minute, stirring constantly. Pour in marinara sauce and add dried Italian seasoning. Simmer for 5 minutes. Season to taste with salt and black pepper.
05 - In a mixing bowl, combine softened cream cheese, ricotta, sour cream, Parmesan, and egg. Stir until mixture is smooth and cohesive.
06 - Spread half the cooked spaghetti evenly in the prepared baking dish. Layer with half the cheese mixture, followed by half the meat sauce.
07 - Repeat layering with remaining spaghetti, cheese mixture, and meat sauce, finishing with meat sauce on top.
08 - Sprinkle shredded mozzarella cheese evenly over assembled layers. Cover baking dish tightly with foil.
09 - Bake covered for 30 minutes. Remove foil and bake an additional 15 minutes until cheese is golden and bubbling.
10 - Allow baked casserole to rest uncovered for 10 minutes before slicing. Garnish with fresh parsley if desired.