Mercury is preferred in barometers because it has a very low vapour pressure, even at room temperature.
This ensures that the mercury column inside the barometer does not evaporate easily, which would otherwise lead to inaccurate pressure readings.
While high density is also advantageous (as it allows shorter column heights), the main reason is its low vapour pressure which prevents contamination of the vacuum above the mercury column.