Darwin already explained it.
"In the Articulata we can commence a series with an
optic nerve merely coated with pigment, and without any other mechanism; and from this low stage, numerous gradations of structure, branching off in two fundamentally different lines, can be shown to exist, until we reach a moderately high stage of perfection. In certain crustaceans, for instance, there is a double
cornea, the inner one divided into facets, within each of which there is a lens shaped swelling. In other crustaceans the transparent
cones which are coated by pigment, and which properly act only by excluding lateral pencils of light, are convex at their upper ends and must act by convergence; and at their lower ends there seems to be an imperfect vitreous substance. With these facts, here far too briefly and imperfectly given, which show that there is much graduated diversity in the eyes of living crustaceans, and bearing in mind how small the number of living animals is in proportion to those which have become extinct, I can see no very great difficulty (not more than in the case of many other structures) in believing that natural selection has converted the simple apparatus of an
optic nerve merely coated with pigment and invested by transparent membrane, into an optical instrument as perfect as is possessed by any member of the great Articulate class."--Charles Darwin, "Origin of Species"
http://www.talkorigins.org/faqs/origin/chapter6.html