Preheat the oven to 350°F (175°C). Butter a 10 x 14-inch baking pan or prepare two pie pans.
Cook the spaghetti according to package directions until al dente; do not rinse. Drain, reserving a little pasta water if it clumps.
In a large bowl, combine the hot cooked spaghetti with the butter, grated Parmesan, and eggs; toss thoroughly so the butter melts and the eggs coat the pasta.
Press the spaghetti mixture evenly into the prepared baking pan (or divide between two pie pans). If using two pans, you may freeze one for later if desired.
Pour the spaghetti sauce evenly over the top of the packed spaghetti.
Spoon or spread the cottage cheese over the sauce, then sprinkle additional grated Parmesan on top.
Bake in the preheated oven for 30 minutes.
Remove the pan from the oven, sprinkle the shredded mozzarella evenly over the top, and return to the oven for about 10 more minutes until the cheese melts and is lightly golden.
Let the pie rest a few minutes before slicing and serving.