The Bible doesn't actually say so, but I always assumed that it was for food.
No, it doesn't say why. But, at that time nobody of faith could do anything without animal sacrifice, so we might assume that they would continue that practice aboard the Ark. For food they would have grain, milk. Fresh veggies would have been a problem.