"For he knew that Jerusalem must be destroyed, because of the wickedness of the people."
Because Lehi was obedient in following the Lord he was warned of the danger and immanent destruction of Jerusalem because of the wickedness of the people. Much like the destruction of Sodom and Gomorrah and even the humbling of the Israelites under the leadership of Moses.
It is an extreme level of wickedness with which the Lord must destroy the city or the area to keep the evil from flooding the earth in it's entirety. The Lord protects His people and if it means the destruction of one person or a nation then, with warning, it will be carried out if not repent of their wicked ways. Even if, in Sodom and Gomorrah, one person would either repent or was righteous then the Lord would have spared the cities. It's because of this wickedness it was ultimately destroyed.
Lehi self obey Lord Lehi warn danger destroy Jerusalem. People there evil sin. Same destroy city #Sodom, #Gomorrah and same Isreal group, them become humble, leader self Moses.
Wicked high need Lord destroy city or place. Protect world cover evil. Lord protect people mean destroy person or country. Himself warn then happen if not repent. If city #Sodom #Gomorrah 1 person repent or right do city save will, but none have. Reason that evil city destroy finish.