Warm the olive oil in a wide skillet over medium-low heat and cook the sliced garlic 1 to 2 minutes until pale gold.
Add the rosemary and red pepper flakes and cook 30 seconds until fragrant.
Add the drained beans and stir to coat in the garlicky oil.
Pour in the broth and bring to a gentle simmer.
Simmer 8 to 10 minutes, stirring now and then, until the broth reduces by half and turns silky.
Stir in the spinach if using and cook 1 minute until wilted.
Remove from the heat, discard the rosemary sprig, and stir in the lemon juice, salt, pepper and parsley.
Serve warm with a drizzle of olive oil and shaved Parmesan if you like.