Forests are a natural home for many animals and they consume fruits, leaves, etc. from the trees. Hence in case of deforestation, the animals would be homeless and hungry and hence will cause a loss of biodiversity.
Also, trees help in rainfall and cutting them down causes a reduction in the rainfall.