Cook the spaghetti: Boil in salted water until just al dente. Drain and toss with the melted butter so it doesn’t stick.
Make the meat sauce: In a large skillet, cook the ground beef and onion until browned. Drain off excess grease. Add garlic and cook 1 more minute. Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer 5–10 minutes.
Mix the eggs and milk: In a large bowl, whisk together eggs, milk, and a little salt and pepper. Add cooked spaghetti and toss to coat (this helps the noodles set nicely when baked).
Assemble: Spread half of the spaghetti mixture into a greased 9x13-inch baking dish. Spoon half the meat sauce over it, then sprinkle with half the mozzarella and Parmesan. Repeat the layers with the remaining spaghetti, sauce, and cheese.
Bake: Cover with foil and bake at 350°F for 20 minutes. Remove foil and bake 10–15 minutes more, until bubbly and golden.
Rest & serve: Let it sit 10 minutes before cutting so it sets up a bit.