Because the pressure a liquid exerts depends on the height of its column, and it is that pressure which drives water out of the taps.
Water in the tank is connected to every tap in the house by pipes. The taller the column of water standing above a tap, the greater the pressure at that tap. Placing the tank on the roof makes this column as tall as possible, so the water leaves the taps in a strong stream and can also reach taps on the upper floors.