Preheat the oven to 350°F (175°C).
Cook the spaghetti according to package instructions until al dente.
In a skillet, brown the ground beef over medium heat, seasoning with salt and pepper.
Drain excess fat and add marinara sauce to the skillet; simmer for 5 minutes.
In a bowl, combine ricotta cheese, egg, Italian seasoning, and a pinch of salt.
In a baking dish, layer half of the spaghetti, followed by half of the meat sauce.
Spread the ricotta mixture over the meat sauce.
Add the remaining spaghetti and top with the rest of the meat sauce.
Sprinkle with mozzarella and Parmesan cheese.
Bake in the preheated oven for 30 minutes until bubbly and golden.