Preheat oven to 400°F and line a sheet pan with parchment.
Halve the squash lengthwise and scoop out the seeds.
Brush cut sides with 1 tbsp olive oil; season with a pinch of salt and pepper. Place cut side down on the pan.
Roast until the flesh shreds easily with a fork, 40 to 45 minutes. Let cool briefly.
Warm remaining 1 tbsp olive oil in a saucepan over medium heat. Soften onion 3 to 4 minutes, stirring.
Stir in garlic; cook 30 seconds. Add marinara, Italian seasoning, and red pepper flakes. Simmer 8 to 10 minutes; season with salt and pepper to taste.
Scrape the roasted squash into strands with a fork. Toss with the warm marinara or plate squash and spoon sauce over top.
Finish with basil and Parmesan. Serve hot.