Elevation gain is a measurement used to classify how difficult a ride was or would be, from the time before power meters. I blame Jobst.
That said, most riders still don't have power meters--but if you do, it's not hard to figure out a pretty good estimate of how much of your energy was spent on mgh. Then calculating h is easy.