Heat the olive oil in a large pot or Dutch oven over medium heat. Add the chopped onion, carrots, and celery. Sauté until softened, about 5-7 minutes.
Stir in the minced garlic, Italian seasoning, and red pepper flakes (if using). Cook for another minute until fragrant.
Pour in the vegetable broth and add the rinsed cannellini beans and chopped sun-dried tomatoes. Bring the mixture to a simmer.
Reduce the heat to low, cover, and let it simmer for at least 10 minutes to allow the flavors to meld. For a creamier soup, carefully use an immersion blender to blend about half of the soup directly in the pot until smooth. Alternatively, scoop out about 2 cups of the soup, blend it in a regular blender, and return it to the pot.
Stir in the fresh spinach and cook until it wilts, about 2-3 minutes.
Remove the pot from the heat. Stir in the grated Parmesan cheese until melted and incorporated. Season generously with salt and freshly ground black pepper to taste.
Ladle the soup into bowls. Garnish with extra Parmesan cheese and fresh basil leaves, if desired.