Why did Allaah cause the children of Israel to die with a thunderbolt (lightning) then bring them back to life?
Question

                If all muslims will die once and then be resurrected on the Day of Judgment, why were the People of Israel caused to die by a lightening and then brought back to life ? (Quran 2:55).
Praise be to Allah.
    Allaah tells us in His Holy Book the story of the smiting of 
    the Children of Israel, then how He brought them back to life after death, 
    in two places. It is mentioned in the context of speaking of the Children of 
    Israel and the blessings that Allaah bestowed upon them, and how they 
    responded to those blessings with ingratitude, denial and forgetfulness. 

    Allaah, may He be exalted, says: (interpretation of the 
    meaning):

    “And (remember) when you said: ‘O Moosa (Moses)! We shall 
    never believe in you until we see Allaah plainly.’ But you were seized with 
    a thunderbolt (lightning) while you were looking.

    56. Then We raised you up after your death, so that you 
    might be grateful”

    [al-Baqarah 2:55-56]

    And He says (interpretation of the meaning): 

    “The people of the Scripture (Jews) ask you to cause a 
    book to descend upon them from heaven. Indeed, they asked Moosa (Moses) for 
    even greater than that, when they said: “Show us Allaah in public,” but they 
    were struck with thunderclap and lightning for their wickedness. Then they 
    worshipped the calf even after clear proofs, evidences, and signs had come 
    to them. (Even) so We forgave them. And We gave Moosa (Moses) a clear proof 
    of authority”

    [al-Nisa’ 4:153]

    The thunderbolt was a punishment for them for their 
    transgressions against Allaah and their persisting in stubbornly asking 
    questions and their arrogance despite all the signs and proof that Allaah 
    showed to them. And despite that they asked Allaah to let them see Him 
    plainly in this world, and they made their faith conditional upon this sign, 
    although Allaah is far above weak eyes seeing Him in this world; rather they 
    will see Him in Paradise. So He punished them with death by thunderbolt 
    which seized them mightily, but because of His forbearance, forgiveness and 
    tolerance towards His slaves, He resurrected them after death to this world, 
    so that they might know how great Allaah's blessing to them was and give 
    thanks to Him for giving them a respite and allowing them the opportunity 
    once again to repent and turn back to Him. So the thunderbolt was a 
    punishment for them and the resurrection after death was a sign and a 
    blessing from Him so that they might learn a lesson and be reminded by it, 
    and then give true and sincere thanks for the blessing of Allaah. Hence the 
    verse in Soorat al-Baqarah ends with the words “so that you might be 
    grateful”.  

    Al-Haafiz Ibn Katheer (may Allaah have mercy on him) says:  

    Remember My blessing to you, when I brought you back to life 
    after the thunderbolt, when you asked to see Me plainly, which you and those 
    like you cannot do – as Ibn Jurayj said.  

    Ibn ‘Abbaas said concerning this verse, “And (remember) 
    when you said: ‘O Moosa (Moses)! We shall never believe in you until we see 
    Allaah plainly in’”: (it means) clearly. End quote. 

    Tafseer al-Qur’aan il-‘Azeem 
    (1/264). 

    Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said: 

    The words “And (remember) when you said: ‘O Moosa (Moses)!” 
    mean: remember also, O Children of Israel, when you said... This is 
    addressed to those who were alive at the time of the Messenger (blessings 
    and peace of Allaah be upon him), but His blessings to the first of the 
    nation are also blessings to the last of them, so it is valid to address it 
    to the latter ones, even though this blessing came to those who went before 
    them. And His words “ ‘We shall never believe in you’” mean: we will 
    never follow you, and we will never believe, and we will never acknowledge 
    that which you have brought. 

    His words “you were seized with a thunderbolt (lightning)” 
    mean: death which was sent upon them. 

    And His words: “Then We raised you up after your death”: 
    this is a great blessing to them, that Allaah seized them with its 
    punishment, then He raised them again so that they might be deterred and it 
    might be an expiation for them. Hence He said: “so that you might be 
    grateful”, i.e. that you might give thanks to Allaah. This is explaining 
    the reason. End quote. 

    Tafseer Soorat al-Baqarah 1/191 

    Al-Taahir ibn ‘Ashoor (may Allaah have mercy on him) said: 

    This was an alert and a rebuke to them, hence He said: “for 
    their wickedness.” The wickedness in question is what is narrated in 
    Soorat al-Baqarah, when they refused to believe Moosa until they saw Allaah 
    plainly. Their wickedness was not in merely asking to see Him, because Moosa 
    had made a similar request on another occasion, of which Allaah tells us in 
    the verse where He says (interpretation of the meaning): 

    “And when Moosa (Moses) came at the time and place 
    appointed by Us, and his Lord (Allaah) spoke to him; he said: ‘O my Lord! 
    Show me (Yourself), that I may look upon You.’ Allaah said: ‘You cannot see 
    Me, but look upon the mountain; if it stands still in its place then you 
    shall see Me.’ So when his Lord appeared to the mountain, He made it 
    collapse to dust, and Moosa (Moses) fell down unconscious. Then when he 
    recovered his senses he said: ‘Glory be to You, I turn to You in repentance 
    and I am the first of the believers’” 

    [al-A’raaf 7:143]

    End quote. 

    Al-Tahreer wa’l-Tanweer (4/301) 

    And Allaah knows best.