Because when the wind blows, and its force moves the tree, the tree does not move uniformly.
As a living organism, a tree is in a constant state of development, so the fibres in its trunk and branches are all at different stages of development - some are fully mature and dry, some are new and full of sap. As the trrunk and branches move, different areas of the wood respond differently. Some move a good deal, some don't move at all.
As different fibres with different tensile strengths which are in close proximity react - or not - to the force of the wind, they rub against each other with friction. This is what causes the distinctive 'creaking' noise when a tree is bending in the wind.



