Repairing a barn roof requires a small investment compared to the greater challenge of barn roof replacement. More than one property owner has sought repairs only to find they would not be enough. Perhaps the barn was covered with layered generations of wooden shingles. In that case an inspector might have found old layers infested with bugs, or mold. These could transfer to beams or walls - so you really need to replace the whole roof.
Perhaps your barn roof has already fallen in. Barn roof replacement may be even more costly then, but it really becomes your only option. Not fixing means that your barn could become shelter for rodents and other pests. This could do more than draw a visit from the health department. All it takes is one adventurous neighborhood kid to wander into your barn and get hurt, and the next thing you know your in court facing a liability suit. The lawyer will emphasize how you neglected your responsibility to replace that roof.