In a large pot over medium-high heat, heat olive oil. Add carrots, celery, and onion and cook until beginning to soften, 5 minutes. Add garlic, cumin, coriander, and red pepper flakes, and cook 1 minute, stirring constantly, then season with salt and pepper.
Add tomatoes, lentils, thyme, and vegetable broth and bring to a boil. Reduce heat, cover partially, and simmer until lentils are tender and soup has thickened, 20 minutes. (If most of liquid has been absorbed, add in ½ to 1 cup more water.)
Stir in spinach and continue cooking until wilted, 2 minutes, then season with salt and pepper.
