Preheat and prep the squash: Heat the oven to 400°F (200°C). Halve the spaghetti squash lengthwise and scoop out the seeds. Drizzle the cut sides with 1 tablespoon olive oil and season with salt and pepper.
Roast the squash: Place cut-side down on a parchment-lined baking sheet.
Roast 35–45 minutes, until the skin pierces easily with a knife and the strands pull away with a fork. Larger squash may need a little longer.
Cook the asparagus: About 10 minutes before the squash is done, heat the remaining 1 tablespoon olive oil in a large skillet over medium heat. Add shallot and cook 2–3 minutes until softened.
Add asparagus and a pinch of salt. Sauté 4–6 minutes, until crisp-tender and bright green. Add garlic in the last 30 seconds and cook just until fragrant.
Remove from heat.
Fluff the squash: When the squash is cool enough to handle, use a fork to scrape the flesh into spaghetti-like strands. Transfer the strands to a large bowl. Season with a pinch of salt, black pepper, and the lemon zest.
Make it creamy: Add ricotta, Parmesan, thyme, and red pepper flakes (if using) to the warm squash.
Toss gently until coated and creamy. If it seems too thick, add a splash of warm water or a squeeze of lemon juice to loosen.
Fold in the asparagus: Add the asparagus and shallot mixture. Toss again, taste, and adjust with more salt, pepper, or lemon juice.
Serve: Divide into bowls.
Top with extra Parmesan and fresh herbs, if you like. Serve warm.