Firefighters brought the blaze under control and the surviving animals are receiving vet treatment.
Scottish Water said the incident happened in Kennoway, Fife, on Friday afternoon and a dedicated team worked for more than 24 hours.
Police Scotland said the 44-year-old was taken to hospital after the incident in Fife.
The High Court in Edinburgh heard Darren Napier, 33, had a history of previous convictions.