In a Dutch oven or other large, heavy-bottomed pot, heat olive oil over medium heat. Add onions and cook until soft and starting to brown, about 5 minutes.
Add carrots and celery and cook, stirring occasionally, until slightly soft and coated in oil, 7-8 minutes.
Add garlic and cook until soft and slightly golden, about 1 minute. (Be careful not to let the garlic burn.)
Add tomatoes and their liquid, vegetable stock, water, and lentils, and season with salt and black pepper to taste. Bring to a boil.
Add bay leaf, celery leaves, oregano, fennel seed, and sugar and reduce to a simmer.
Cook, uncovered, until the lentils and vegetables are tender, about 45 minutes. Stir occasionally and season with salt and pepper as needed.
Stir in one or two splashes of red wine vinegar and serve.