Cook spaghetti according to package directions. Drain well. Preheat the oven to 350 degrees F (180 degrees C.)
Slice all but 50 mL (1/4 cup) of the pepperoni into thin strips.
Stir the pepperoni strips, onion, green pepper, mushrooms (if using), oregano, basil, pizza sauce, half of the cheese, eggs and Parmesan in a large bowl until well combined. Toss the sauce mixture with the cooked pasta.
Transfer the mixture to a greased 9 x 13-inch (3L) baking dish. Sprinkle with the remaining cheese and dot with the reserved pepperoni slices. Bake for 30 minutes. Let the dish stand for 5 minutes; slice and serve with additional warmed pizza sauce if desired.
Make this casserole your own by stirring in your favourite pizza toppings.