I was talking about a secular discussion of the causes of these accidents and the measures taken to prevent them.
From a religious point of view, Islam would hold that the suffering is as a result of human failure. In this case, it would be inadequate safety precautions related to cranes.
There is a secondary explanation that Allah also allows suffering to be a test of the faith and charity of others.
Both of these are almost identical to the explanation offered by Christianity, which is hardly surprising, given their shared ancestry.
Edit: found this on an "ask the scholar" website;
"So to summarize, we can say that sufferings occur to teach us that we must adhere to Allah’s natural and moral laws. It is sometimes to punish those who violate Allah’s natural or moral laws. It is to test our faith in Allah and to test our commitment to human values and charity. Whenever we encounter suffering we should ask ourselves, “Have we broken any law of Allah?” Let us study the cause of the problem and use the corrective methods. “Could it be a punishment?” Let us repent and ask forgiveness and reform our ways. “Could it be a test and trial for us?” Let us work hard to pass this test."
Almost identical to the explanation I was given at my CofE primary school.