# reduced the cities of Sodom and Gomorrah to ashes

"burned the cities of Sodom and Gomorrah with fire until only ashes remained"

# condemned them to destruction

Here the word "them" refers to Sodom and Gomorrah and the people who lived in them.

# as an example of what is to happen to the ungodly

Sodom and Gomorrah serve as an example and a warning of what will happen to others who disobey God.