this is just how the metagame worked itself out. riot didnt really do anything in particular to cause ranged champs to take over toplane.
think about it in terms of the meta:
Top lane is considered an "island." This is due largely in part to dragon location and the irrelevance of baron until much later in the game.
As a result, you must be a good duelist to compete in top lane, this generally includes winning your lane without help, or with minimal help. It also helps tremendously to have the mobility to split push, since you will likely be the player on your team who takes teleport.
So in order to be a strong duelist, you need gold. In order to get gold, you need to farm safely and/or push your opponent out of lane. Thus, top lane becomes inhabited by counterpicks and lane bullies with the requirement that they are able to split push or deny a split push safely.
This means that you can't pick champions that 'lose lane' in order to scale (ex: Nasus) because there is a high probability that you will be heavily denied gold by a big lane bully such as Azir who scales almost as well as you do. This also means you can't pick champions with obvious weaknesses (ex: Shyvana) or you risk being easily counterpicked.
Is it Riot's fault that some champions are worse in lane than others? You could say that, but if all champions were equally powerful in lane we would also lose a lot of the choices that are made in champion select and a lot of the unique feeling that a lot of champions give. We don't want them to homogenize picks so much that every champion is equally powerful in lane with the same spikes in power oriented completely through items.