Cook and drain the spaghetti. Run cold water over the cooked spaghetti until cool. Pour the well-drained spaghetti noodles into a large 9x13 pan with a lid if you are planning to freeze. Add half of the pasta sauce to the noodles and mix in well.
Next, mix in 3/4 of the pepperoni until evenly distributed. Mix in 1/2 cup of shredded mozzarella cheese and half of the Parmesan cheese. Top the pasta with half of the remaining pepperoni and half of the remaining cheese.
Repeat the layers of pepperoni and cheese until you have used all of the pepperoni and all of the cheese. The number of layers depends on the size of the pan. You can cook immediately or cover and label the pan for freezing.