Preheat oven to 400 F. Place broccoli florets on a baking sheet. Drizzle with about 1 tbsp of olive oil, 1/2 tsp salt, and 1/2 tsp pepper. Toss to combine. Bake for 25-30 minutes, stirring halfway, until florets are browned and tender Set aside to cool for 5 minutes
Place roasted broccoli, nuts, remaining 1/2 tsp of salt, 1/2 tsp pepper, spinach, Parmesan cheese, garlic and lemon juice in a food processor or blender. Pulse to combine.
Gradually add in 1/4 cup of olive oil while blending. Pulse until pesto is desired consistency (I like it on the chunky side). Add more olive oil if needed.
Cook pasta/spaghetti squash. Toss with broccoli pesto and serve with dollops of ricotta cheese.
Top with extra Parmesan cheese and crushed red pepper flakes if desired.