In Exodus, God tells Moses that when the Israelites leave Egypt, they are to borrow from the Egyptians, ultimately for the purpose of stealing what they borrow:
Exodus 3:20-22
20 And I will stretch out my hand, and smite Egypt with all my wonders which I will do in the midst thereof: and after that he will let you go.
21 And I will give this people favour in the sight of the Egyptians: and it shall come to pass, that, when ye go, ye shall not go empty.
22 But every woman shall borrow of her neighbour, and of her that sojourneth in her house, jewels of silver, and jewels of gold, and raiment: and ye shall put them upon your sons, and upon your daughters; and ye shall spoil the Egyptians.
And, when the children of Israel leave Egypt, they do exactly that:
Exodus 12:35-36
35 And the children of Israel did according to the word of Moses; and they borrowed of the Egyptians jewels of silver, and jewels of gold, and raiment:
36 And the Lord gave the people favour in the sight of the Egyptians, so that they lent unto them such things as they required. And they spoiled the Egyptians.
How is this not a violation of God's many commands not to steal (Exodus 20:15, Leviticus 19:13, Deuteronomy 5:19)? Is this God commanding something wicked?
In Genesis chapter 15, God foretold Abraham of the fact that his descendants would be slaves in Egypt, and also that "afterward they shall come out with great substance":
Genesis 15:13-14
13 And he said unto Abram, Know of a surety that thy seed shall be a stranger in a land that is not theirs, and shall serve them; and they shall afflict them four hundred years;
14 And also that nation, whom they shall serve, will I judge: and afterward shall they come out with great substance.
The Israelites were unjustly enslaved in Egypt (Exodus 1:8-14), for 400 years. There was legitimate slavery under the Law of God, but the Israelites being enslaved as a group, for generations, was not legitimate, or just.
So, God's command for the Israelites to steal from the Egyptians can be seen as a form of reparations. They, and their ancestors, had been defrauded of wages for 400 years by the Egyptians. Therefore, as a punishment on Egypt, and to correct the injustice, God took the payment by force, via the Israelites.
Morality is whatever God defines it as, so it is impossible for any of this to be immoral, unless you have found someone who more powerful than God, and able to enforce their morality on Him. It is impossible to do something immoral, if one is obeying God.
For instance, in the normal course of events, it's clearly immoral to kill one's child (Exodus 20:13, Deuteronomy 5:17). If God tells someone do it however, as He did Abraham (Genesis 22:1-2), one would be sinning not to obey.
The suspension of the regular rules of morality, though, is highly abnormal. In both of the cases just referenced, God directly told the individuals involved, by special revelation, to do something. In those cases, God, who knows everything, has a very good reason for doing so. In the case of the Egyptians, He knows infinitely more about the Egyptians, and what they justly deserved, than anyone trying to stand in judgment of this account.
God carried out judgment on the Egyptians via the Israelites, by having them steal their valuables. This not only served to punish the Egyptians for unjustly enslaving the Israelites, but also corrected the injustice, by giving the Israelites wealth that they and their ancestors had been defrauded of.