Preheat the oven: Set to 350°F (175°C). Grease a 9x13-inch baking dish.
Cook the spaghetti: Boil in salted water until just shy of al dente (about 1–2 minutes less than package). Drain and toss with the butter so it doesn’t stick.
Make the meat sauce: In a large skillet, heat a drizzle of olive oil.
Add the onion and cook 3–4 minutes until softened. Stir in garlic for 30 seconds. Add ground beef, breaking it up, and cook until browned.
Drain excess fat.
Season and simmer: Stir in marinara, tomato paste, Italian seasoning, red pepper flakes, salt, and pepper. Simmer 5–10 minutes until thickened and flavorful.
Mix the creamy layer: In a bowl, combine cream cheese, ricotta, sour cream, and half of the Parmesan. Season with a pinch of salt and pepper.
Mix until smooth.
Assemble the casserole: Spread half of the spaghetti in the dish. Dollop and spread half of the creamy mixture over the pasta. Spoon on half the meat sauce.
Sprinkle a handful of mozzarella. Repeat the layers with remaining spaghetti, creamy mixture, meat sauce, and mozzarella. Top with remaining Parmesan.
Bake: Cover with foil and bake for 20 minutes.
Uncover and bake another 10–15 minutes until the top is bubbly and lightly golden.
Rest and serve: Let it rest for 10 minutes so the layers set. Garnish with chopped parsley or basil. Slice and serve.