Preheat the oven to 350°F (175°C).
Cook spaghetti according to package instructions, then drain and set aside.
In a large bowl, mix ricotta cheese, eggs, garlic powder, Italian seasoning, salt, and pepper.
Add the cooked spaghetti to the ricotta mixture and stir until well combined.
Grease a pie dish and layer half of the spaghetti mixture at the bottom.
Spread half of the marinara sauce over the spaghetti layer.
Add half of the mozzarella cheese on top of the sauce.
Repeat the layers with the remaining spaghetti, marinara sauce, and mozzarella cheese.
Sprinkle grated Parmesan cheese on top for a golden finish.
Bake in the preheated oven for 30-40 minutes until the top is bubbly and golden brown.