Dams are used to store river waters, which are later used in generating hydroelectricity.
Water stored at higher altitudes do possess potential energy, and when they are let flow from higher altitudes they possess higher kinetic energy, which automatically improves the output of the hydroelectric power station.
Hence, the dams are constructed at a higher altitude.