Preheat oven to 350°F (175°C). Grease a 9x13-inch baking dish and place it on a rimmed baking sheet to catch any sauce that bubbles over. Set aside.
Boil salted water and cook spaghetti 1-2 minutes less than package directions for al dente. Drain well, but do not rinse the pasta.
Whisk eggs with melted butter and half the grated Parmesan. Pour over drained spaghetti and toss quickly with tongs to coat every strand before the eggs scramble from the heat.
Sauté onion in a large skillet over medium-high heat until softened, about 3-4 minutes. Add ground beef and cook until no pink remains, about 6-8 minutes. Add garlic and cook 1 minute until fragrant. Drain excess grease.
Stir marinara sauce, Italian seasoning, salt, and pepper into the meat mixture. Simmer on low for 5 minutes to meld flavors. Set aside.
In a medium bowl, combine cottage cheese with sour cream until evenly mixed.
Spread 1/2 cup meat sauce on the bottom of the baking dish. Layer half the egg-coated spaghetti over the sauce and press into an even layer. Spread all the cottage cheese mixture over the noodles, then sprinkle with 1/2 cup mozzarella. Top with half the remaining meat sauce.
Add the remaining spaghetti as a second layer, pressing gently. Top with the remaining meat sauce, spreading to the edges. Sprinkle with the remaining 1.5 cups mozzarella and remaining Parmesan cheese.
Cover tightly with aluminum foil and bake covered for 35-40 minutes until heated through and bubbly at edges. Remove foil and bake uncovered for 15-20 minutes more until cheese is melted, bubbly, and golden brown in spots.
Rest for 10-15 minutes before cutting into squares and serving. Garnish with fresh basil or parsley if desired.