Allah has names of Beauty: the Compassionate, the Merciful, the Gentle, and many others. But He also has Names of Rigour: the Overwhelming, the Just, the Avenger. The world in which we live exists as the interaction and the manifestation of all of the divine attributes. Hence it is a place of ease and of hardship, of joy and of sorrow.
It has to be this way: a world in which there was only ease could not be a place in which we can discover ourselves to be true human beings. It is only by experiencing hardship, and loss, and bereavement, and disease, that we rise above our egos, and show that we can live for others, and for principles, rather than only for ourselves.
Shaykh Abdal-Hakim Murad