Leviticus 18:9 says that having sexual relations with a sister is forbidden by God, yet Abraham did. He married his half sister; yet he was considered righteous by God. How could that be?
It’s true, Abraham married his half sister Sarah. They had the same father but different mothers (Genesis 20:12). The commandment prohibiting marriage to a sister didn’t come until several hundred years later. But irrespective of that, in Romans 4:3 Paul wrote that Abraham believed God and it was credited to him as righteousness. It was a direct quote from Genesis 15:6.
Even though Abraham and Sarah were disobedient at times, God blessed them mightily. Sarah was so beautiful that even though she was 65 years old at the time the Pharaoh of Egypt took her into his harem (Genesis 12:15). (Most harem girls were probably in their teens.) But God kept her pure and enabled her to bear Abraham a child and even to nurse him when she was 90 years old and he was 100 (Genesis 21:5-7). Some commentators believe Abraham was one of the wealthiest men of his time.
The same principle that God applied to Abraham allows Him to see us as being righteous, too. Most people don’t marry close relatives today, but we all sin just the same and continually fall short of the glory of God. Like Abraham, we’ve been given a righteousness apart from the Law. Our righteousness comes through faith in Jesus Christ, and because of it we have been justified freely by His grace through the redemption He purchased for us on the cross (Romans 3:21-24).
“Now when a man works, his wages are not credited to him as a gift, but as an obligation. However to the man who does not work but trusts God who justifies the wicked, his faith is credited to him as righteousness” (Romans 4:4-5).