Cook spaghetti in salted boiling water until al dente (one minute less than package directions). Drain and set aside.
Heat olive oil in a large skillet over medium-high heat. Sauté diced onion for 3–4 minutes until softened.
Add minced garlic and stir for 30 seconds until fragrant.
Add ground beef, break apart with a spoon, and cook until fully browned. Drain excess grease.
Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer on low heat for 10 minutes.
In a bowl, combine ricotta cheese, eggs, half the mozzarella, and half the parmesan. Mix until smooth.
Preheat oven to 375°F (190°C). Grease a 9x13-inch baking dish.
Toss cooked spaghetti with half the meat sauce and spread into the baking dish.
Spread the ricotta cheese mixture evenly over the pasta layer.
Pour remaining meat sauce on top and sprinkle with remaining mozzarella and parmesan.
Cover with aluminum foil and bake for 25 minutes.
Remove foil and bake for an additional 10–15 minutes until cheese is golden and bubbly.
Let rest for 5–10 minutes before slicing and serving. Garnish with fresh parsley.