Heat the oven to 400°F. Slice the tops off the garlic heads, drizzle with olive oil, and wrap each head in foil. Roast for 35 minutes until the cloves are soft and golden.
Place the lentils, onion, carrots, celery, diced tomatoes, vegetable broth, rosemary, bay leaves, salt, and pepper in the slow cooker.
Squeeze the roasted garlic cloves out of their skins and add them to the slow cooker. Stir everything together.
Cover and cook on low for 7 hours until the lentils are tender.
Stir in the spinach during the last 10 minutes of cooking so it wilts but keeps its color. Remove the bay leaves before serving.