The Jews were Rebellious instead of Appreciative when They gained Victory
Allah tells;
وَإِذْ قُلْنَا ادْخُلُواْ هَـذِهِ الْقَرْيَةَ فَكُلُواْ مِنْهَا حَيْثُ شِيْتُمْ رَغَداً وَادْخُلُواْ الْبَابَ سُجَّداً
And (remember) when We said;"Enter this town (Jerusalem) and eat bountifully therein with pleasure and delight wherever you wish, and enter the gate in prostration (or bowing with humility),
Allah admonished the Jews for avoiding Jihad and not entering the holy land as they had been ordered to do when they came from Egypt with Musa.
They were also commanded to fight the disbelieving Amaliq (Canaanites) dwelling in the holy land at that time. But they did not want to fight, because they were weak and exhausted.
Allah punished them by causing them to become lost, and to continue wandering, as Allah has stated in Surah Al-Ma'idah.
The correct opinion about the meaning of,
`the holy land' mentioned here is that it was Bayt Al-Maqdis (Jerusalem), as As-Suddi, Ar-Rabi bin Anas, Qatadah and Abu Muslim Al-Asfahani, as well as others have stated.
Musa said,
يَاقَوْمِ ادْخُلُوا الاٌّرْضَ المُقَدَّسَةَ الَّتِى كَتَبَ اللَّهُ لَكُمْ وَلَا تَرْتَدُّوا
O people! Enter the holy land which Allah has assigned to you and turn not back (in flight). (5;21)
However, some scholars said that;
the holy land is Jericho, (Ariha') and this opinion was mentioned from Ibn Abbas and Abdur-Rahman bin Zayd.
After the years of wandering ended forty years later, in the company of Yuwsha` (Joshua) bin Nun, Allah allowed the Children of Israel to conquer the holy land on the eve of a Friday. On that day, the sun was kept from setting for a little more time, until victory was achieved. When the Children of Israel conquered the holy land, they were commanded to enter its gate while,
سُجَّداً
(prostrating) in appreciation to Allah for making them victorious, triumphant, returning them to their land and saving them from being lost and wandering.
Al-Awfi said that Ibn Abbas said that,
وَادْخُلُواْ الْبَابَ سُجَّداً
(and enter the gate Sujjadan) means,
"While bowing".
Ibn Jarir reported Ibn Abbas saying,
وَادْخُلُواْ الْبَابَ سُجَّداً
(and enter the gate in prostration) means,
"Through a small door while bowing."
Al-Hakim narrated it, and Ibn Abi Hatim added,
"And they went through the door backwards!"
Al-Hasan Al-Basri said that;
they were ordered to prostrate on their faces when they entered the city, but Ar-Razi discounted this explanation.
It was also said that;
the Sujud mentioned here means, `submissiveness', for actually entering while prostrating is not possible.
Khasif said that Ikrimah said that Ibn Abbas said,
"The door mentioned here was facing the Qiblah."
Ibn Abbas, Mujahid, As-Suddi, Qatadah and Ad-Dahhak said that;
the door is the door of Hittah in Iylya, which is Jerusalem.
Ar-Razi also reported that;
some of them said that it was a door in the direction of the Qiblah.
Khasif said that Ikrimah said that Ibn Abbas said that;
the Children of Israel entered the door sideways.
As-Suddi said that Abu Sa`id Al-Azdy said that Abu Al-Kanud said that Abdullah bin Mas`ud said that;
they were commanded to,
وَادْخُلُواْ الْبَابَ سُجَّداً
(enter the gate in prostration (or bowing with humility)) but instead, they entered while their heads were raised in defiance.
Allah said next,
وَقُولُواْ حِطَّةٌ
and say;`Hittah',
Ibn Abbas commented,
"Seek Allah's forgiveness."
Al-Hasan and Qatadah said that it means,
"Say, `Relieve us from our errors."
نَّغْفِرْ لَكُمْ خَطَايَاكُمْ وَسَنَزِيدُ الْمُحْسِنِينَ
and We shall forgive you your sins and shall increase (reward) for the good-doers.
Here is the reward for fulfilling Allah's commandment.
This Ayah means, "If you implement what We commanded you, We will forgive your sins and multiply your good deeds."
In summary, upon achieving victory, the Children of Israel were commanded to submit to Allah in tongue and deed and, to admit to their sins and seek forgiveness for them, to be grateful to Allah for the blessings He gave them, hastening to do the deeds that Allah loves, as He said,
إِذَا جَأءَ نَصْرُ اللَّهِ وَالْفَتْحُ
وَرَأَيْتَ النَّاسَ يَدْخُلُونَ فِى دِينِ اللَّهِ أَفْوَجاً
فَسَبِّحْ بِحَمْدِ رَبِّكَ وَاسْتَغْفِرْهُ إِنَّهُ كَانَ تَوِبَا
When there comes the help of Allah (to you, O Muhammad against your enemies) and the conquest (of Makkah). And you see that the people enter Allah's religion (Islam) in crowds. So glorify the praises of your Lord, and ask His forgiveness. Verily, He is the One Who accepts the repentance. (110;1-3).
Allah said