It doesn't matter if he believed God or not. God still set him in his place. He sets up evil kings as well as righteous ones. He always has, He does, and He always will until the King of Kings returns. Truth.
It’s far more than the king (Bera is of course mentioned in Genesis 14, who had the honor of meeting Melchizedek but did not know the significance thereof), but also the ordinary people, who were exemplified by Lot’s neighbors (chapter 19).
Notwithstanding, the USA is supposed to know God, making a stark difference here. God doesn’t make an utter destruction of such people when they sin, even to more depraved levels than Sodom.