In fact, illusions are a powerful and fun tool for revealing constraints that mediate vision and perception. In some cases, illusions take place because the constraints for interpreting an image are ambiguous. Your visual system can interpret the scene in more than one way. Even though the image on your retina remains constant, you never see an odd mixture of the two perceptions - it is always one or the other, although they may perceptually flip back and forth. Normally, this does not happen in the real world, as your visual system has evolved many different ways to resolve ambiguity.
Visual perception is essentially an ambiguity-solving process.
The visual system is also highly adaptive, e.g., visual adaptation is not merely fatique. It should be understood that both evolution and learning contribute to visual capabilities. Artists have also been trying to understand how we perceive, and much of our understanding of vision comes from learning how artists manipulate images into meaningful and realistic scenes. Artists have always created illusions. That's their business.