The Rambam writes:
Desire leads to coveting, and coveting leads to stealing. For if the owner (of the coveted object) does not wish to sell, even though he is offered a good price and is entreated to accept, the person (who covets the object) will come to steal it, as it is written [in the Book of Micah]: “They covet fields and (then) steal them.” [Micah 2:2] And if the owner approaches him with a view to reclaiming his money or preventing the theft, then he will come to murder. [Mishneh Torah, Hilkhot Gezelah v’Avedah 1:11]
So the Rambam views “Do not covet” as a protective fence that avoids a cascade of infractions. For example, coveting your neighbor's wife might lead to murder of her husband. If the adultery is not known and leads to a child, the father is misidentified, and the child does not get to inherit from his real father, which is a form of theft. The child does not get to honor his real father, which breaks another commandment. If the matter is known, the child is tagged as a bastard, and may marry only another bastard. If he can't find one, he cannot marry, which means fewer Jews to observe Shabbat and commandments.
However, the Talmud makes clear that, while coveting is forbidden, there is no punishment for it:
[There is no punishment for mere evil intention], for it is said [in the Book of Psalms]: “If I saw iniquity in my heart, the Lord would not hear.” [Ps. 66:18]... [If evil] intention does not [lead to action], the Holy One, blessed be He, does not [punish it]. [Kiddushin 40a]
The Talmud also says we can refrain from coveting by not looking into our neighbors’ affairs: If two people share the same courtyard, each can force his neighbor to build a wall in the middle so neither can look into the other's half. [Bava Batra 2a]
Ibn Ezra holds that it's all a matter of training children since their youth, and THERE is the implied action behind the commandment. He writes that a person does not desire to lie with his mother, although she may be beautiful, because he has been trained since his youth to know that she is forbidden to him. He does not desire non-kosher meat just as we Westerners do not desire snake meat or fried ants: It's a psychological result of our training. Proper education can regulate improper coveting. As it says in the Book of Proverbs:
Train a child in the way that he should go, and even when he is old, he will not depart from it. [Prov. 22:6]
Also, if we wasted time wishing for what we don't have, we would not spend as much time appreciating what we do have, and may even lose it. The Talmud says:
Whoever sets his eyes on what is not his, loses also what is his. [Sotah 9a]