EDIT: assuming a constant altitude flight
If you fly from point A to point B in one hour at 10,000 feet, and then fly from point A to point B in one hour at 30,000 feet, GPS will report the same speed for both flights. It does not bother to correct for the slightly longer path at 30,000 feet because that level of precision is simply not needed for commercial aviation.
GPS is inherently 3 dimensional.
The solution is a datum, a model of the Earth's surface that is used for the conversion. WGS84 is the datum used by GPS, and approximates the Earth as a specified ellipsoid. However, maps can use use different datums (data?), so there can be a discrepancy of many meters between what GPS says the location is, and what the map says the location is, and they can both be right relative to their datum.
GPS allows you to directly measure displacement of any 2 points in 3 dimensions.
You're speaking of the altitude + lat/lon instead, which is in polar coordinates.