Why does the airplane need windows?

There are times when the pilots need to look outside. It is still safer to do this with windows instead of using cameras that can fail.