In some cases, height is countable:
[uncountable, countable] the measurement of how tall a person or thing is
In this sense, height means measurement, and measurements are countable. Your sentence with "...various heights" is correct.
Height is uncountable when it refers to the property of tallness:
The height of the mountain did not discourage them.
The mountain has some uncountable amount of height.
Even if we deal with multiple mountains, we can still have a single uncountable height property:
The height of the mountains did not discourage them.
This means the tallness of multiple mountains did not discourage them. It's similar to, "The fact that the mountains were tall did not discourage them." (But this is very awkward phrasing.)
The heights of the mountains did not discourage them.
This means that they measured (or otherwise learned) the individuals heights of multiple mountains (e.g., one was 5000 feet, another was 6000 meters, etc.) and were not discouraged by the sizes of the measurements.
(Note that the plural heights (and rarely in the singular) has yet another possible meaning of "high places," as in, "I have a fear of heights." That is not my intended meaning of "heights" in the above sentence.)
For s similar uncountable property, consider speed:
We need more speed to outrun our opponents.
And, by comparison, consider the countable form of speed:
The runner's speed was 6 kilometers per hour.
The runners all ran at different speeds: 5 kilometers per hour, 6 kilometers per hour, and 7 kilometers per hour.