Preheat your oven to 400°F (200°C). Slice off the top of the garlic head to expose the cloves, drizzle with olive oil, wrap in foil, and roast for 30-35 minutes until soft and caramelized. Once cool, squeeze out the roasted garlic cloves and set aside.
Bring a large pot of salted water to a boil. Add penne pasta and cook until al dente according to package instructions. Drain and set aside, reserving some pasta water.
Heat olive oil in a large skillet over medium heat. Add shrimp, season with salt, pepper, and red pepper flakes. Cook for 2-3 minutes per side until pink and opaque. Remove shrimp and set aside.
In the same skillet, add roasted garlic cloves and mash slightly. Add halved cherry tomatoes and cook for 2-3 minutes until softened. Toss in spinach leaves and cook until wilted.
Return shrimp to skillet. Add cooked penne pasta and toss gently. Add reserved pasta water if mixture seems dry.
Transfer pasta mixture to a greased baking dish. Sprinkle shredded mozzarella and grated Parmesan evenly on top.
Bake at 375°F (190°C) for 15-20 minutes until cheese is melted, bubbly, and golden brown.
Remove from oven and let cool slightly. Garnish with fresh basil leaves before serving.