I disagree. Stick with as science based major and you will find optometry school, on the whole, easier. Spanish will not lead you to take physiology or anatomy classes in undergrad and I guarantee you that those will help when you get to OD school. I have a friend who has a language-based degree with me here at SCO and she gets 2000% more frustrated over phys, anatomy, biochem, and neuro than the rest of us. I mean, she took all the prereqs like everyone else, but she just can't seem to get it as easily. The mere exposure to science will be a leg up over the Spanish. Perhaps you can take Spanish as a minor?
You could certainly still do Spanish as a major and get into OD school, it just may be a little tougher because you will only have taken the prerequisites instead of having spent the last 4 years submersed in science.