Because the holy Bible quite clearly condemns all kind of lying in all kind of forms.
Proverbs 19:9 - A false witness shall not be unpunished, and [he that] speaketh lies shall perish.
Proverbs 12:22 - Lying lips [are] abomination to the LORD: but they that deal truly [are] his delight.
Psalms 101:7 - He that worketh deceit shall not dwell within my house: he that telleth lies shall not tarry in my sight.
Ephesians 4:25 - Wherefore putting away lying, speak every man truth with his neighbour: for we are members one of another.
Now whoever was hiding Anne Frank in his house was clearly lying to the Nazis. There was one moment where the Nazis visited the house and the owner clearly lied to the nazis that there are no Jewish people in the house whatsoever.
Now this was clearly a lie and some liberals would say it was moraly acceptable. But truth is the Bible makes no exeptions and all lying is bad and wrong. The only answer that the Bible is giving us that if we were in the same situation we have to tell the nazis the truth.
Even if it means that all those children hiding in your house will be dying you have to tell the truth. I'm certain if you dig deeper into this issue you will find that if everyone did the right thing from the beginning no one would have to hide anyway.
Meaning that if the Jews would have obeyed the holy Bible they might not be in a situation where they have to hide from anyone. But certainly as a Christian you have to tell the truth and certainly there are no moral exeptions to this.