The Sages taught: Whoever sets his eyes on what is not his — what he seeks is not given to him, and what he has is taken from him; for so we find with the primordial serpent... The Holy One, blessed be He, said: I said he would be king over every beast and animal, and now “cursed are you more than all the cattle and more than every beast of the field.”
On the daf / in context: The serpent’s ambition for what was not his resulted in the loss of both the desired status and the status he already possessed.
Method — The baraisa states a general ethical principle: whoever fixes his desire on what is not his loses what he already has and does not receive what he sought. The serpent is the example: it desired Chavah, whom it could not have, and lost the dominion over the animals that God had originally intended for it.