This is so because of excessive use of water which depletes the ground water.
Towns and cities have asphalted roads and vast areas of soil are concreted. As a result, rain water cannot percolate to recharge ground water and the ground water level further decreases. Villages have larger areas of open soil surface and fewer asphalted roads and concrete surfaces. Thus, larger soil surface area is available for rain water to percolate into the soil easily and recharge the ground water. As a result, even shallow bore wells yield water.