Barn fires are absolutely heartbreaking.
If you look at the patterns of barn fires, they typically occur during the coldest weeks of winter and the hottest parts of summer. This is because most barn fires are related to electrical appliances (fans and heaters) and electrical issues.
I don’t know what the cause was at this farm, but the main cause of summer barn fires is indoor type box fans. If you care about not having a barn fire, do not use cheap box fans designed for indoor use. Only use only fans with enclosed motors designed for outdoor conditions. Do not leave fans on when the barn is unattended. No fans on at night unless you have a night watchman. Best practice if possible would be to turn horses out at night.
During winter, heating devices are the main causes of fires. Do not use space heaters unattended in barns. Avoid using unattended bucket heaters. Do not use, at all, the bucket heaters that can bring water to a boil. The risk if you get distracted and walk away is too great.
For year round fire prevention, make sure all wiring is enclosed in conduit. Periodically inspect wiring and electrical boxes/outlets. Electrical outlet boxes do need to be periodically replaced. Be quick to replace any wiring with evidence of fraying or having been chewed on. Frequently inspect any electrical appliances that are used in the barn and be quick to dispose of older or worn appliances. If possible, store items like hay and gasoline in separate buildings. Keep walls and ceilings free from cobwebs. Have multiple large fire extinguishers located throughout the barn and replace as necessary.
I know the idea of a fire suppression system sounds nice, but they are extremely expensive and barns are large, sometimes multistory buildings. After a friend’s devastating barn fire, I priced it out and it was prohibitive. However, the data is clear on what causes barn fires and other than buying enclosed motor fans, prevention is relatively cheap.