Preheat your oven to 350°F (175°C). Grease a 9×13 inch baking dish and set aside.
In a large pot, cook the spaghetti according to the package instructions until al dente. Drain and set aside.
In a skillet, heat the olive oil over medium heat. Add the diced onion and cook until translucent, about 5 minutes. Add the minced garlic and cook for another minute until fragrant.
Add the ground beef or turkey to the skillet, breaking it up with a wooden spoon. Cook until browned and fully cooked, about 8-10 minutes. Drain any excess fat if needed.
Stir in the marinara sauce, dried basil, dried oregano, salt, and pepper. Let the mixture simmer for 10 minutes to combine the flavors.
In a mixing bowl, combine the softened cream cheese and sour cream until smooth.
In a large bowl, toss the cooked spaghetti with the cream cheese mixture until well coated.
Spread half of the spaghetti mixture in the prepared baking dish. Top with half of the meat sauce. Repeat the layers with the remaining spaghetti mixture and meat sauce.
Sprinkle the shredded mozzarella cheese and grated Parmesan cheese evenly over the top of the casserole.
Cover the baking dish with aluminum foil and bake in the preheated oven for 25 minutes. Remove the foil and bake for an additional 10 minutes, or until the cheese is melted and bubbly.
Let the casserole cool for a few minutes before serving. Garnish with chopped fresh parsley if desired.