In a large pot over medium heat, warm the olive oil. Add the onion, carrot, celery and ½ teaspoon salt and cook for 5 minutes, stirring occasionally, or until softened.
Add the garlic, tomato paste, fennel, and red pepper flakes (if using) and cook for 1 minute, stirring often (to cook the tomato paste). Stir in the veggies and lentils to coat in the spices and tomato. Stir in the water, soy sauce, and remaining 1 teaspoon salt.
Increase the heat to high and bring to a boil, then reduce the heat to medium-low and simmer, covered, for 25-30 minutes, stirring halfway through, or until the lentils are tender.
Stir in the spinach (if using) and cook until it wilts down, submerging it into the broth, about 2 minutes. Remove from heat and stir in the lemon juice.
For the spiced oil, add the oil and spices into a small saucepan over medium heat. Once you start to hear the spices sizzle a bit and become fragrant, remove from heat and transfer to a heat-proof glass or ceramic jar. Stir in the salt and let cool.
Serve soup topped with spiced oil.