**Cook the Pasta:**
Preheat your oven to 375°F (190°C). Cook the pasta in a large pot of salted boiling water until al dente. Drain and set aside.
**Prepare the Meat Sauce:**
In the same pot, cook the ground beef or Italian sausage over medium heat until browned and fully cooked. Drain any excess grease. Stir in the marinara sauce, garlic powder, Italian seasoning, and red pepper flakes (if using). Simmer for 5 minutes.
**Assemble the Casserole:**
In a large mixing bowl, combine the cooked pasta and meat sauce. Mix well to coat. Spread half of the pasta mixture into a greased 9x13-inch baking dish. Sprinkle 1 cup of mozzarella cheese and half of the Parmesan cheese over the top. Layer with half of the pepperoni slices and any additional toppings you like.
**Add the Second Layer:**
Spread the remaining pasta mixture over the first layer. Top with the remaining mozzarella and Parmesan cheese. Arrange the remaining pepperoni slices on top.
**Bake the Casserole:**
Cover the dish with aluminum foil and bake for 20 minutes. Remove the foil and bake for an additional 10-15 minutes, or until the cheese is melted and bubbly.
**Serve:**
Let the casserole rest for 5 minutes before serving. Garnish with fresh parsley or basil if desired.