Why do my eyes sting when I use a shampoo or conditioner with certain chemicals even if it doesn't touch them?

Vapors. Many shampoos contain chemicals that vaporize when used, such as fragrances and emollients. You might, at least, be sensitive to these and the surface of your eye reacts. This can be especially true if your eyes are dry.
Possibly fumes. The surface of the eye is very sensitive to irritants and chemicals. Even the fumes from certain substances can be irritating. Best treatment is to thoroughly irrigate the eyes with lukewarm water for several minutes. Over-the-counter artificial tears can be used for soothing relief, as well. If the stinging persists despite these measures, see an ophthalmologist promptly.