Asalamu'Alaikum Brothers and Sisters in Islam.....
First of all let's go over some concepts from the Holy Quran to better understand that Verse.
(Instead of being grateful, you did something outlandish.) While We summoned Moses for forty nights to reveal Our Commandments, you took to worshiping the golden calf in his absence. You were once again hurting yourselves. (7142)
252 Then, even after that, We pardoned you and gave you another chance to show gratitude (256).
253 And We gave Moses the Code of Law and the Criterion for you to clearly distinguish between right and wrong to lead you on the Lighted Road.
254 When Moses returned, he said to his people, ?O my people! You have hurt your own ?Selves? by worshiping the calf (7148-156). So, turn in repentance to your Maker and kill your ego (rebellious mentality 1253). This will be best for you in the Sight of your Maker.? Thereupon He turned toward you accepting your repentance. Verily, He is the Acceptor of repentance, the Merciful.
255 And recall when you said, ?O Moses! We will not believe in you unless we see Allah face to face!? Thereupon lightning thunder overtook you and overpowered your sight and senses.
256 Then We revived you, and raised you from a dead to a living nation so that you might show gratitude by following the Divine System of Life.
257 When you mended your ways, We overshadowed you with Our Grace and We bestowed upon you Our Bounties in abundance, saying, ?Partake of the decent things We have provided you.? And they did no harm to Us - but they certainly harmed their own ?Selves?.
258 Then We commanded you, ?Enter this town and enjoy the provisions therein ? partake as you desire. But enter the gate with heart-felt humility, saying, ?HITTATUN? ? ?Our Lord! Pardon our misdeeds as we mend our ways?, - and We shall forgive you your faults and amply reward the doers of good.?
259 But, the transgressors altered the meaning of the words they had been given, and changed their attitude of humility and perseverance. So, Our Law of Cause and Effect brought down upon them the consequences of their drifting away from the Commandments.
260 (Remember the times when you were in the Sinai desert and there was shortage of water.)
And Moses asked for water for his people. We said, ?Smite the rock with your staff.? And there gushed out twelve springs so that each tribe found its respective source of fresh cool water. Moses said, ?Enjoy Allah?s provision, but desist from creating disruption and chaos in the land for selfish gains.?
261 (At one stage you demanded Moses to provide you with a great variety of edibles, although you were living in the Sinai desert.) You said, ?O' Moses! We are weary of the same kind of food, so ask your Lord that He brings forth for us plant food such as herbs, cucumbers, garlic, lentils and onions.? He said, ?Would you exchange something superior for something inferior?
(Preoccupy yourselves with petty desires instead of higher goals?) Go back in shame to Egypt and you will get what you demand.? So, humiliation and misery were stamped upon them and they had to face the Divine Requital. That was because they kept rejecting Allah's Messages. And they persisted in opposing and even killing some Prophets against all right. They did all this, because they chose to rebel against the Divine Commands, and committed excesses against humanity.
Inshallah... I hope I was able to clarify a few things for all those seeking knowledge..
Your brother in Islam,
Abideen.....