You are correct, it's not a programming issue.
Pokémon GO is made by the company Niantic. Previously, Niantic created a very similar game to Pokémon GO called Ingress. The locations of Pokémon in GO are the exact same as the locations used in Ingress. Seriously, most of Pokémon GO is just reskinned Ingress. Ingress locations are population-based, and there are more Ingressmahobbits (I don't play Ingress so I don't know any of the real terms) portals, they're called portals in urban areas than out in the boondocks. Pokéstops and Gyms in GO are the same locations as the portals in Ingress. So, the logic is that because Ingress had less of a rural following, when GO adopted its locations it suffered the same way.
A source I found.
Also, as for having different Pokémon for different terrain: While not confirmed, The Silph Road analyzed the capture data of Pokémon GO and found that different species of Pokémon do in fact appear in different biomes. For example, arid areas have lots of Ground and Fire Pokémon and forested areas (like where I live) have more Grass and Bug Pokémon. Pidgey and Ratatta are not location based, they will show up anywhere.