Preheat your oven to 350°F (175°C).
Cook the spaghetti according to package instructions until al dente; drain and set aside.
In a large bowl, mix ricotta cheese, eggs, Italian seasoning, salt, and pepper.
Combine cooked spaghetti with the ricotta mixture until evenly coated.
Grease a pie dish with cooking spray or olive oil.
Press half the spaghetti mixture into the bottom of the pie dish to form a crust.
Spread half the marinara sauce over the spaghetti layer.
Add half of the mozzarella and Parmesan cheese on top.
Repeat with the remaining spaghetti, sauce, and cheeses.
Bake in the preheated oven for 25-30 minutes until golden and bubbly.