Yes, the fear of heights is hereditary. The fear of heights, also known as acrophobia, is a specific phobia. Specific phobias such as the acrophobia run in families, and is moderately heritable (Van Houtem et al., 2013). There are also significant environmental influences which contribute to the transmission of specific phobias such as acrophobia (Lichtenstein and Annas, 2000). So although the fear of heights runs in families, there are both genetic and environmental factors involved in the transmission of this anxiety disorder.
References:
A review and meta-analysis of the heritability of specific phobia subtypes and corresponding
fears. Van Houtem CM, Laine ML, Boomsma DI, Ligthart L, van Wijk AJ, De Jongh A. J Anxiety Disord. 2013 May;27(4):379-88.
Heritability and prevalence of specific fears and phobias in childhood. Lichtenstein P, Annas P. J Child Psychol Psychiatry. 2000 Oct;41(7):927-37.