The midrash at B'reshis Rabba 3:7 states that G-d created a number of worlds and destroyed them before the creation of our world. Is the Midrash implying that the earlier worlds included sentient beings with free will who had to be destroyed because they defied G-d? How else can the Midrash be explained?
Rabbi Akiva Tatz has a speech about this in which he explains the concept in depth. His speech can be found at http://www.simpletoremember.com/media/a/the974generations-of-souls/