I'd hazard a guess that it's a manifestation of the magic in the spear rather than an actual organ of something.
Given that when you complete the spear the eyeball disappears and its description becomes "The tip of this spear, covered with horrifying barbs, strikes unerringly towards its target's eyes." which goes together with its innate magical effect of being able to proc blindness and deal extra damage to "Certain creatures that sport multiple sets of eyes".
Meaning that its magic is very much about stabbins the eyeballs. So when broken, it manifests this power instead into conjuring up an eyeball to stab.