Preheat the oven to 450 degrees F. Bring a large pot of salted water to a boil.
Combine the zucchini, yellow squash, tomatoes, fennel, onion, garlic and oregano in a large bowl. Add the olive oil, red pepper flakes and a pinch each of salt and pepper and give it a good toss. Dump that out onto 2 baking sheets and spread it out evenly. Roast until the squash and other vegetables begin to caramelize, 15 to 25 minutes. Scrape the vegetables into a large bowl and cover with a plate to keep warm.
The pasta water should be boiling by now. Add the spaghetti and stir to separate the strands. Cook until al dente, 8 to 9 minutes, then drain.
Toss the spaghetti with the vegetable mixture. Squeeze the lemon juice over the top and toss together. Divide among bowls. Garnish with parmesan, if desired.