Preheat oven to 350°F. Grease a 2-quart baking dish or spray with nonstick cooking spray. Spread a very thin layer of marinara sauce in the bottom of the pan (about ¼ cup). Set aside.
Cook spaghetti in a large pot of well-salted boiling water according to package directions for al dente. Drain.
While the spaghetti cooks, brown the ground beef or sausage in a large skillet over medium heat until no longer pink. Drain off excess grease. Stir in the remaining marinara sauce. Taste and season with salt and pepper, if desired.
Add half of the meat sauce (about 1 ¼ cups) to the cooked spaghetti; toss to coat. Set aside.
In a separate bowl, whisk together the cream cheese, ricotta (or cottage cheese), sour cream, butter, Italian seasoning, garlic powder, ¼ teaspoon kosher salt (if using cottage cheese, omit the salt), and ground black pepper to taste. Set aside.
Spread half of the spaghetti mixture in the bottom of the prepared baking dish. Spread half of the cream cheese mixture and then half of the remaining meat sauce over top. Repeat the layers with the remaining spaghetti mixture, the remaining cream cheese mixture, and the remaining meat sauce. Finish by sprinkling the shredded Italian cheese and grated Parmesan cheese over top.
Bake, uncovered, until the sauce is bubbling and the cheese is golden brown on top, about 30 minutes. Place the dish under the broiler for a minute or two if you’d like the cheese even browner and crispier on top. Let stand 5-10 minutes before slicing and serving. Garnish with chopped fresh herbs, if desired.