Preheat oven to 425°F. Line a rimmed sheet pan with parchment.
Halve the squash lengthwise and scrape out seeds with a spoon.
Rub cut sides with olive oil, then season with salt and pepper.
Place squash cut-side down on the pan. Prick shells a few times with a fork.
Roast until the flesh is tender and strands pull easily, 35–45 minutes.
While it roasts, whisk pesto, cream, Parmesan, lemon juice, garlic, and red pepper in a bowl. Fold in spinach.
Flip squash cut-side up and cool 5 minutes. Use a fork to rake strands into a large bowl, leaving shells intact.
Toss hot squash strands with the creamy pesto until evenly coated. Adjust salt and pepper to taste.
Pack the mixture back into the squash shells. Top with shredded mozzarella.
Return to oven and broil or bake until cheese is melted and browned in spots, 2–4 minutes.
Finish with pine nuts and fresh basil. Serve hot.