Please remember, that happened before there was a Law against it.Now these are the names of the children of Israel who came to Egypt; each man and his household came with Jacob:Reuben, Simeon, Levi, and Judah;Issachar, Zebulun, and Benjamin;Dan, Naphtali, Gad, and Asher.All those who were descendants of Jacob were seventy persons (for Joseph was in Egypt already ).And Joseph died, all his brothers, and all that generation.But the children of Israel were fruitful and increased abundantly, multiplied and grew exceedingly mighty; and the land was filled with them.Now there arose a new king over Egypt, who did not know Joseph.And he said to his people, “Look, the people of the children of Israel are more and mightier than we;come, let us deal shrewdly with them, lest they multiply, and it happen, in the event of war, that they also join our enemies and fight against us, and so go up out of the land.”Therefore they set taskmasters over them to afflict them with their burdens. And they built for Pharaoh supply cities, Pithom and Raamses.But the more they afflicted them, the more they multiplied and grew. And they were in dread of the children of Israel.So the Egyptians made the children of Israel serve with rigor.And they made their lives bitter with hard bondage— in mortar, in brick, and in all manner of service in the field. All their service in which they made them serve was with rigor.Then the king of Egypt spoke to the Hebrew midwives, of whom the name of one was Shiphrah and the name of the other Puah;and he said, “When you do the duties of a midwife for the Hebrew women, and see them on the birthstools, if it is a son, then you shall kill him; but if it is a daughter, then she shall live.”But the midwives feared God, and did not do as the king of Egypt commanded them, but saved the male children alive.So the king of Egypt called for the midwives and said to them, “Why have you done this thing, and saved the male children alive?”And the midwives said to Pharaoh, “Because the Hebrew women are not like the Egyptian women; for they are lively and give birth before the midwives come to them.”Therefore God dealt well with the midwives, and the people multiplied and grew very mighty.And so it was, because the midwives feared God, that He provided households for them.So Pharaoh commanded all his people, saying, “Every son who is born you shall cast into the river, and every daughter you shall save alive.” - Exodus 1:1-22 http://www.biblegateway.com/passage/?search=Exodus1:1-22&version=NKJV
The Hebrew midwives lied to pharaoh to protect the lives of the innocent children, and God rewarded them for that.
A Law now written on our hearts. (Rom 2:15)