The role that God played towards the Jews in the desert was not far removed from that of a parent. While they were on the desert, He provided them with the challenges that would allow them to mature
There is nothing beneficial that comes from suffering that could have not been achieved far more effectively through a positive means.