Preheat your oven to 375°F.
Cook the spaghetti according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and red pepper flakes, sautéing for about 1 minute until fragrant.
Add the cooked spaghetti to the skillet, along with the marinara sauce, salt, and black pepper. Toss to combine and heat through for about 2-3 minutes.
Remove the skillet from heat and stir in the mozzarella cheese until melted and well combined.
While the pasta is heating, hollow out the sourdough bread bowls, leaving about a 1-inch border.
Fill each bread bowl with the cheesy spaghetti mixture, packing it in gently.
Sprinkle the tops with grated Parmesan cheese.
Place the filled bread bowls on a baking sheet and bake in the preheated oven for 15-20 minutes, or until the bread is crispy and the cheese is bubbly.
Remove from the oven and let cool for a few minutes. Garnish with fresh basil leaves if desired before serving.