Heat olive oil in a large Dutch oven over medium-low. Add diced onion, celery, and carrot simultaneously. Cook for 8 to 10 minutes, stirring every 60 to 90 seconds, until the onion is completely translucent, the celery has softened throughout, and the carrot is tender enough to mash against the pot side. The mixture should smell sweet and savory with nothing browned.
Increase heat to medium. Add minced garlic; stir continuously 60 to 90 seconds until fragrant. Add tomato paste to the pot center; cook undisturbed 45 seconds until brick-red. Stir through the soffritto and cook 30 seconds more.
Pour in crushed tomatoes and diced tomatoes, lifting any caramelized bits from the base. Add vegetable broth, dried oregano, thyme, bay leaves, chili flakes, salt, and pepper. Add the Parmesan rind if using. Bring to a gentle boil over medium-high heat.
Reduce to a steady simmer. Add drained cannellini beans, zucchini, and green beans. Simmer uncovered 10 minutes until zucchini is just tender and green beans have lost their raw crunch while still holding shape.
Add small dried pasta directly to the simmering soup. Stir to prevent clumping. Simmer uncovered 10 to 12 minutes, stirring every 2 to 3 minutes, until pasta is tender throughout with no doughy center.
Remove bay leaves, thyme sprigs, and Parmesan rind. Stir in spinach or kale; cook 60 to 90 seconds until wilted. Add lemon juice, stir through, and taste for salt and pepper. Ladle into wide bowls and finish with Parmesan, basil, and an olive oil drizzle.