Preheat oven to 375°F (190°C).
Cook spaghetti according to package directions. Drain and set aside.
In a large skillet, cook ground beef or sausage over medium heat until browned. Drain excess fat.
Add diced onion to the skillet and sauté until softened.
Stir in pizza sauce and season with salt and pepper. Simmer for 5 minutes.
In a greased 9x13-inch baking dish, layer the cooked spaghetti, meat sauce, and half of the shredded mozzarella cheese.
Top with sliced pepperoni, diced bell peppers, black olives, and remaining mozzarella and Parmesan cheese.
Bake for 20-25 minutes, or until cheese is bubbly and golden brown.
Let cool for 5 minutes before serving.