Preheat oven to 350 degrees F (175 degrees C). Prepare a 9x13-inch baking dish with cooking spray.
Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally until cooked through but firm to the bite, about 12 minutes; drain and transfer to a large bowl.
Mix eggs, Parmesan cheese, and butter with the spaghetti to coat pasta completely; spread into the prepared baking dish. Spread cottage cheese over the spaghetti to cover completely. Spread spaghetti sauce over the cottage cheese; top with a layer of mozzarella cheese.