In some places, for example many islands, it is the only land
available to live on. Other people live on volcanoes because they are
beautiful or because it is the only place where the land is affordable.
Building shelters is a good idea but would be expensive. In some
eruption hundreds of thousands of people are evacuated. Even if the
building was at the far end of the island certain geologic hazards
(airfall, pyroclastic flows, tsunami) might still reach it.
Thanks for a good question.
Steve Mattox, University of North Dakota