V'etchanan (Deuteronomy 3:23-7:11 )
And you shall not covet your fellow's wife, you shall not desire your fellow's house... (Deut. 5:18)
We understand why God commanded us not to steal or to kill; after all, it is physically possible for a person to refrain from performing such crimes. On the other hand, jealousy is an emotion and is an integral part of human nature; when you see something you like - you desire it. How can the Torah forbid something so natural as to desire someone else's possessions?
The Ibn Ezra uses a profound insight into human nature to explain this prohibition. It is quite expected that an ignorant, poverty-stricken peasant might covet his neighbor's daughter, but it would never dawn on him to lust after the queen. She is so far away and inaccessible that such a thought would never enter his mind. Sensible, logical people only yearn for things within their frame of reference; they have no interest in things that are beyond their scope or their imagination. Similarly, man must perceive his neighbor's belongings as unattainable, like a golden ingot in Fort Knox.
A storekeeper once complained to R' Meir of Premishlan, "Somebody opened a store right next to mine, and he is taking my business away!" The sage replied, "Have you ever seen a horse drink water from a river? He walks into the water and stamps his hooves. He sees another horse also drinking, he's envious and afraid that the 'other' horse will drink up all the water, and therefore he kicks his own mirror image. That is the attitude of the horse, but you know better. Realize that there is enough water in the river for all the horses, and no one can touch what God has prepared for you. You have nothing to fear or be jealous of."