In the Book of Mormon Student Manuel, it reads:
Scripturally we can see some reasons why the Lord will occasionally show signs to the wicked:
Leave the wicked without excuse. The wicked are completely responsible for their actions thereafter. The Lord has stated, 'He that seeketh signs shall see signs, but not unto salvation' (D&C 63:7).
Show correctness of prophets’ words. Since the wicked seek to prove the prophet wrong, the Lord will occasionally show indisputable signs (see Helaman 9:2-4).
Condemn the wicked. When the wicked see signs, it is through the Lord’s anger and to their condemnation (see D&C 63:11). The Savior stated, 'An evil and adulterous generation seeketh after a sign' (Matthew 12:39).
To vindicate prophets. The sign that Nephi, son of Helaman, gave to the people concerning the death of the chief judge showed that Nephi was right (see Mosiah 20:21).The signs, however, are not for the wicked. They are for the righteous, for the believers. Doctrine and Covenants 63:9 reads: "But, behold, faith cometh not by signs, but signs follow those that believe." True to the Faith says, "Such signs are given to those who are faithful and obedient in order to strengthen them in their faith."