Heat 2 Tbsp olive oil in a large, heavy pot or Dutch oven. Add the pancetta and cook over medium-low heat for 6-8 minutes, stirring occasionally, until lightly browned.
Add the onions, carrots, celery, squash, garlic, and thyme, and cook over medium heat, stirring occasionally, for 8-10 minutes until the vegetables begin to soften.
Add the tomatoes, 6 cups of stock, bay leaf, 1 1/2 tsp pepper, and salt to taste. Bring to a boil, then lower the heat and simmer uncovered for 30 minutes, until vegetables are tender.
Remove the bay leaf. Add beans and cooked grain and heat through. The soup should be thick, but you can add more stock to thin as desired.
Just before serving, add chopped kale, pesto, and white wine (if using) and stir over heat, just until kale is wilted. Add salt and pepper to taste. Serve with Parmesan cheese sprinkled on top.