In addition to the defensive advantages of building on a hill malaria also played a part. In many countries farmers live on their farms. In parts of Italy farmers live in hill towns and travel out to their fields each day. That is because the plains were once infested with malarial mosquitos and the towns were cooler and had fewer mosquitos.
The Dukes of these towns had much better taste than the Roman Catholic Church. I was surprised how poor the interiors of the churches were. A lot of money had been spent on the churches but the money had been spent by people who had little sense of artistic merit.
The Ducal Palace in Urbino.
Urbino at night.