There is actualy very little water vapour absorption in the optical part of the spectrum (350 - 750 nm). If "optical" is extended (as it often is) to include that part of the spectrum where silicon-based CCD detectors are useful (330 - 1000 nm) then there is some water vapour absorption at the long wavelength end of the spectrum.
In the range 350-750 nm, the water vapour absorption appears in the form of discrete "telluric" absorption lines. There are actually quite straightforard to remove by preparing a calibration spectrum in the form of a continuum source (usually a hot B-star or white dwarf), which has few if any intrinsic narrow absorption lines. The lines that are visible in the calibration spectrum and their strength can be scaled for the airmass of any other observation and multiplied out.
i.e. Water vapour absorption is generally NOT the reason that optical observatories are at high(ish) altitudes. The high altitude is to minimise the amount of atmospheric turbulence that blurs the stellar images.
The reasoning is different if the observatory is to perform observations at infrared wavelengths. Here, the water vapour column over the telescope is very important, especially for observations at wavelengths greater than 2 microns. For that reason, the world's best ground-based infrared observatories are at the highest and driest sites - basically on top of Mauna Kea in Hawai'i. The lower temperature at high altitudes also helps with reducing some thermal emission background at infrared wavelengths.