Earthly humanity
From the book: The Gospel according to the Spirititism - Allan Kardec

We are astonished to find on earth so much wickedness and evil passions, so much misery and disease of every kind, and we infer from this that the human species is a sad thing. This judgment comes from the limited point of view in which we place ourselves, and which gives us a false idea of the whole. It is necessary to consider that on earth we do not see the whole of mankind, but a very small fraction of it. In fact, the human species comprises all the beings endowed with reason who populate the innumerable worlds of the universe. Now, what is the population of Earth compared to the total population of these worlds? Much less than that of a village in relation to that of a great empire. There is nothing extraordinary about the material and moral situation of terrestrial humanity when one considers the destiny of the earth and the nature of those who inhabit it.
The Earth, then, offers us one of the types of atonement worlds, the varieties of which are infinite, but which have in common the fact that they serve as a place of exile for spirits rebellious against the law of God. There, these spirits have to struggle at the same time against the perversity of men and against the inclemency of nature, a double painful work which develops at the same time the qualities of the heart and those of the intelligence. Thus, in His goodness, God makes punishment redound to the advantage of the progress of the spirit.
We should form a very false idea of the inhabitants of a great city if we were to judge them by the population of the lowest and most sordid districts. In a hospital one sees only the sick and the crippled; in a prison one sees all the vices and all the dullness gathered together; in the unhealthy districts most of the inhabitants are pale, sickly, and infirm. Well, let us imagine that the earth is a slum, a hospital, a penitentiary, an unhealthy region, for it is all these things at once, and it will be understood why afflictions prevail over enjoyments, for those who are in good health are not sent to the hospital, and those who have done no harm are not sent to the workhouse, for neither hospitals nor workhouses are places of delights.
Now, just as in a city the population is not all in hospitals or prisons, so humanity is not all on earth. And just as one leaves hospital when he is cured, and prison when he has completed his sentence, so man leaves earth for happier worlds when he has been cured of his moral infirmities.