The drag force acting on the airplanes flying at some height in terms of the density of air at the same height is,
where d is the density of air,
The density of air decreases with the increase in altitude.
Thus, to reduce the drag force on the airplane (and lose its energy in opposing the drag force), it is preferred to fly at large altitudes.