Preheat your oven to 375°F (190°C).
Cook the penne pasta according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the Italian sausage and cook until browned, breaking it apart with a spoon, about 5-7 minutes.
Add the diced onion, garlic, and bell pepper to the skillet. Sauté until the vegetables are softened, about 3-4 minutes.
Stir in the drained diced tomatoes, tomato sauce, oregano, basil, red pepper flakes (if using), and season with salt and pepper. Simmer for 5 minutes.
In a large mixing bowl, combine the cooked penne pasta, sausage and vegetable mixture, and half of the mozzarella cheese. Mix well.
Transfer the pasta mixture to a greased 9x13-inch baking dish. Top with the remaining mozzarella cheese, Parmesan cheese, and sliced pepperoni.
Bake in the preheated oven for 25-30 minutes, or until the cheese is bubbly and golden.
Remove from the oven and let it cool for 5 minutes. Garnish with fresh basil leaves if desired. Serve warm.