Well that’s a tough question. I mean, it’s a "why" question and it’s an evolutionary question, and answering "why" questions in biology is very difficult.
In this case, I think we have to go back several hundred million years to see the very first evolving animals with complicated nervous systems that are getting more and more sophisticated.
At some point vision evolved and probably started becoming more important when mammals developed binocular vision, with their two eyes looking forwards from the front of the animal.
This arrangement means that when and animal is looking at something, each of the two retinas - one in each eye - are seeing the same thing, providing binocular 3D vision.
But the point there is that the lens of the eye inverts the image that forms on the retina, so that in binocular animals like us, things seen to our left are sensed by the right half of our left eye, and by the left half of our right eye, and that’s a product of the physics of the situation.
But if each eye were to send all its nerves to just one half of the brain, the picture of the world on one side of the body would be split between the two halves of the brain.
Instead, it makes much more sense for this picture to be fused in just one half of the brain by the crossing over of some of the nerves of the two eyes.
But more recently, people have been thinking theoretically about how can you wire up a clever brain just on first principles and they decided that, probably, it’s useful to wire things crossed over simply because - for reasons we don't need to go into - it prevents or reduces wiring errors compared with if you wire things up just on the same side of the brain.