Bring the lentils to the boil in a large kettle of water and simmer, covered, for 35-40 minutes until soft. Drain.
Heat the oil in a large, heavy-bottomed saucepan and fry the onion, garlic and peppers gently until soft, about 5 minutes.
Mix in the cooked lentils and the tomatoes, parsley, bay leaf and water. Season well. Cook over moderate heat, stirring, for 10-15 minutes, or until most of the liquid has evaporated and the mixture is fairly thick.
Preheat oven to 400 degrees.
Spoon the mixture into a lightly greased ovenproof dish, removing the bay leaf. Make four slight hollows with the back of a spoon. Break in the eggs. Sprinkle with the sherry, cover and bake for 20 minutes, or until the egg whites are firm.