Peel and dice the onion, carrots, and celery into 1/4 inch pieces. Mince the garlic, cut the zucchini into 1/2 inch pieces, and trim and cut the green beans into 1 inch lengths.
Rinse the cannellini and kidney beans under cold water until the foam is gone, then drain. Chop the parsley, measure the dried herbs into one dish, and keep the basil leaves whole.
Heat 3 tablespoons of olive oil in a Dutch oven over medium heat. Add the onion, carrots, celery, tomato paste, and a pinch of salt and cook for 7 to 10 minutes until the vegetables soften and the paste darkens to brick red.
Add the minced garlic, zucchini, green beans, oregano, dried basil, and thyme. Stir constantly for about 2 minutes until fragrant, keeping the garlic moving so it doesn't burn.
Pour in the diced tomatoes with juices, vegetable broth, and 2 cups of water, scraping up browned bits. Add the salt, black pepper, red pepper flakes, and bay leaves, then bring to a boil.
Reduce the heat to medium low, set the lid slightly ajar, and simmer for 15 minutes, stirring once or twice, until the carrots are almost tender.
Stir in the drained cannellini beans, kidney beans, and dry ditalini. Simmer uncovered for 10 to 15 minutes, stirring every few minutes, until the pasta is tender with a slight bite.
Add the baby spinach in two or three handfuls, stirring each under the hot broth before adding the next. Cook for 1 to 2 minutes until wilted and still bright green.
Remove the pot from the heat and discard the bay leaves. Stir in the lemon juice, remaining 1 tablespoon of olive oil, and chopped parsley, then taste and adjust salt and pepper.
Let the soup rest for 5 minutes, then ladle into warm bowls, reaching to the bottom so everyone gets plenty of beans and pasta. Top with fresh basil leaves and vegan Parmesan if using.