In the story of the great flood, God is distressed with man’s evil behavior. He decides that the only recourse is to destroy man and let civilization start anew. Unfortunately, in killing all the people by a flood, all the animals will also die (except for those saved by the ark).
This, of course, is not fair to the animals. They are taken out because of man’s mistakes.
There is an interesting parallel in this today. Man’s behavior is again threatening the lives of animals. This time man’s mistakes result in excessive economic gain and greedy prosperity at the expense of animal habitat.