The verse says the Devil was given power, presumably by God: ie. all the kingdoms of the Earth. The devil then gives that power to whoever he chooses.
Again, in a later passage from Luke:
Jesus said to them, "The kings of the Gentiles lord it over them; and those who exercise authority over them call themselves Benefactors. But you are not to be like that. (So what did the Church go and do? It became the Holy Roman Empire!)