Typically, the insurance company will pay for damages caused by a tree falling onto the roof of a building. However, there are some caveats. For example, the insurance company will certainly try to determine if the tree was damaged before the event happened.
A typical insurance contract is designed to protect the owner from perils, such as high winds. These are circumstances that the owner of the property cannot guard against, and therefore has purchased insurance to guard against.
However, if the tree was damaged by termites or was dead or dying, the insurer might determine that the owner should have known this was the case, and refuse to pay.
With respect to your exact question, if a tree falls on a roof that is already in disrepair, if the tree does a great deal of damage, it will be unlikely for a claims adjuster to determine the level of disrepair before the tree fell on it. Therefore, the condition of the roof prior to the tree falling would be irrelevant.
So, if it is clear that the falling tree did very little, or no real damage to the structure of the roof, the claims adjuster will determine that the insurance company is not liable to pay anything, since the roof would still function as it did before the tree fell.
Thus, your question really hinges on whether the tree demolished the roof or if it is merely lying on top of the structure now. A roof that previously allowed leaks here and there or had shingles missing might seem like disrepair to you, but would be seen as structurally sound to an adjuster. However, it is also just as important to note the condition of the tree and the conditions that caused it to fall in the first place.