As David Stratton states, Abraham was simply trying to not get killed. She was a beautiful woman, so another, more powerful man could simply kill him and take her as his wife. So to save himself Abraham simply said Sarah was his sister, which was a half truth.
So the Pharaoh made Abraham rich by offering gifts, but when he was going to take Sarah as his wife, God intervened. Pretty much the same thing happened in Chapter 20 with Abimelech, king of Gerar.
Genesis 12:11-13 Pretty much explains the reason:
11 And it came to pass, when he was close to entering Egypt, that he said to Sarai his wife, “Indeed I know that you are a woman of beautiful countenance. 12 Therefore it will happen, when the Egyptians see you, that they will say, ‘This is his wife’; and they will kill me, but they will let you live. 13 Please say you are my sister, that it may be well with me for your sake, and that I may live because of you.”