Had Isaac not gone to Abimelech, he would not have had to lie about his wife. He lied about his wife just as his father, Abraham, had lied about his wife, Sarah. Isaac left his communion with God and ended up by sinning against the Lord.
There are two important lessons we need to learn from Isaac's imitating his father's example.
First, it is much easier for children to imitate the weaknesses or vices of their parents than to excel in their virtues. It is easier because it is natural.
Second, while Abraham and Isaac were men of vastly different temperaments, each succumbed to the same temptation. When famine arose, they fled for help. While they were in the land of the enemy, they both became afraid and lied about their wives.
This proves that natural man is under the control of the same adamic nature in which there is no good thing. The Apostle Paul recognized this and said, "For I know that in me (that is, in my flesh,) dwelleth no good thing: for to will is present with me; but how to perform that which is good I find not" (Rom. 7:18).
Abraham and Isaac both had the adamic nature, even as we do, and they yielded to temptation in similar situations. They had to realize that unless they applied the grace of God, they would inevitably fall into sin. This should also serve as a warning to us.
"Train up a child in the way he should go: and when he is old, he will not depart from it" (Prov. 22:6).