Hairy black holes and gravitational solitons in three dimensions for the new massive gravity theory proposed by Bergshoeff, Hohm and Townsend (BHT) are considered at the special case when there is a unique maximally symmetric solution. Following the Brown-York approach with suitable counterterms, it is shown that the soliton possesses a fixed negative mass which coincides with the one of AdS spacetime regardless the value of the integration constant that describes it.Hence, the soliton can be naturally regarded as a degenerate ground state labeled by a single modulus parameter. The Euclidean action, endowed with suitable counterterms, is shown to be finite and independent of modulus and hair parameters for both classes of solutions, and in the case of hairy black holes the free energy in the semiclassical approximation is reproduced. Modular invariance allows to show that the gravitational hair turns out to be determined by the modulus parameter. According to Cardy's formula, it is shown that the semiclassical entropy agrees with the microscopic counting of states provided the modulus parameter of the ground state is spontaneously fixed, which suggests that the hairy black hole is in a broken phase of the theory. Indeed, it is found that there is a critical temperature T c = (2πl) −1 characterizing a first order phase transition between the static hairy black hole and the soliton which, due to the existence of gravitational hair, can take place in the semiclassical regime.