Preheat your oven to 375°F (190°C). Cook the spaghetti according to package directions until al dente. Drain and set aside.
In a large skillet, brown the ground beef over medium-high heat. Drain off any excess grease.
Add the chopped onion and minced garlic to the skillet and cook until softened, about 5 minutes.
Stir in the crushed tomatoes, tomato paste, Italian seasoning, salt, and pepper. Bring to a simmer, then reduce heat and cook for 10 minutes, stirring occasionally.
In a separate bowl, combine the ricotta cheese, egg, and Parmesan cheese. Mix well.
In a greased 9x13 inch baking dish, spread half of the cooked spaghetti. Top with the ricotta mixture, then spread the meat sauce over the ricotta. Layer the remaining spaghetti on top, and finish with the shredded mozzarella cheese.
Cover the baking dish with foil and bake for 25 minutes. Remove the foil and bake for another 15 minutes, or until the cheese is melted and bubbly.
Let it rest for 5-10 minutes before serving.
Notes
This dish is even better the next day! It can also be assembled ahead of time and baked when ready to serve.