01 - Preheat the oven to 400°F. Line a baking sheet with parchment paper.
02 - Cut the spaghetti squash in half lengthwise. Scoop out the seeds. Brush the cut sides with 1 tablespoon olive oil and season with salt and pepper.
03 - Place squash halves cut-side down on the baking sheet. Roast for 35-40 minutes, until tender and strands easily pull away with a fork.
04 - While the squash roasts, heat the remaining olive oil in a large skillet over medium heat. Add sausage; cook, breaking it up with a spoon, until browned and cooked through, about 6-7 minutes.
05 - Add onions and bell peppers. Sauté for 5 minutes until softened. Stir in garlic, oregano, basil, and red pepper flakes (if using); cook 1 minute more.
06 - Pour in the marinara sauce. Simmer for 5 minutes, then remove from heat.
07 - Once the squash is cool enough to handle, use a fork to scrape the flesh into spaghetti-like strands. Discard the skins.
08 - Reduce oven temperature to 375°F.
09 - In a large mixing bowl, combine squash strands, sausage mixture, half the mozzarella, and half the Parmesan. Mix well and season to taste.
10 - Transfer mixture to a greased 9x13-inch baking dish. Top with remaining mozzarella and Parmesan.
11 - Bake uncovered for 15-20 minutes, until bubbly and golden.
12 - Let rest 5 minutes before garnishing with fresh basil and serving.