Heat olive oil in a large pot over medium heat. Add onion, carrots, and celery; cook until softened, about 5–6 minutes.
- Stir in garlic and cook for 1 minute until fragrant.
- Add white beans, broth, crushed tomatoes, rosemary, thyme, and bay leaf. Season with salt and pepper. Bring to a boil, then reduce heat and simmer for 15 minutes.
- Stir in pasta and cook until al dente according to package instructions.
- Add spinach or kale and cook until wilted, 1–2 minutes.
- Remove bay leaf, taste, and adjust seasoning as needed.
- Serve hot, topped with grated Parmesan cheese.