SB 10.1.42

yato yato dhāvati daiva-coditaṁ
 mano vikārātmakam āpa pañcasu
guṇeṣu māyā-raciteṣu dehy asau
 prapadyamānaḥ saha tena jāyate
Synonyms: 
yataḥ yataḥ — from one place to another or from one position to another; dhāvati — speculates; daiva-coditam — impelled by accident or deliberation; manaḥ — the mind; vikāra-ātmakam — changing from one type of thinking, feeling and willing to another; āpa — at the end, he obtains (a mentality); pañcasu — at the time of death (when the material body turns totally into matter); guṇeṣu — (the mind, not being liberated, becomes attached) to the material qualities; māyā-raciteṣu — where the material energy creates a similar body; dehī — the spirit soul who accepts such a body; asau — he; prapadyamānaḥ — being surrendered (to such a condition); saha — with; tena — a similar body; jāyate — takes birth.
Translation: 
At the time of death, according to the thinking, feeling and willing of the mind, which is involved in fruitive activities, one receives a particular body. In other words, the body develops according to the activities of the mind. Changes of body are due to the flickering of the mind, for otherwise the soul could remain in its original, spiritual body.
Purport: 

One can very easily understand that the mind is constantly flickering, changing in the quality of its thinking, feeling and willing. This is explained by Arjuna in Bhagavad-gītā (6.34):

cañcalaṁ hi manaḥ kṛṣṇa
 pramāthi balavad dṛḍham
tasyāhaṁ nigrahaṁ manye
 vāyor iva suduṣkaram

The mind is cañcala, flickering, and it changes very strongly. Therefore Arjuna admitted that controlling the mind is not at all possible; this would be as difficult as controlling the wind. For example, if one were in a boat moving according to the wind on a river or the sea, and the wind were uncontrollable, the tilting boat would be very much disturbed and extremely difficult to control. It might even capsize. Therefore, in the bhava-samudra, the ocean of mental speculation and transmigration to different types of bodies, one must first control the mind.

By regulative practice one can control the mind, and this is the purpose of the yoga system (abhyāsa-yoga-yuktena). But there is a chance of failure with the yoga system, especially in this Age of Kali, because the yoga system uses artificial means. If the mind is engaged in bhakti-yoga, however, by the grace of Kṛṣṇa one can very easily control it. Therefore Śrī Caitanya Mahāprabhu has recommended, harer nāma harer nāma harer nāmaiva kevalam. One should chant the holy name of the Lord constantly, for the holy name of the Lord is nondifferent from Hari, the Supreme Person.

By chanting the Hare Kṛṣṇa mantra constantly, one can fix the mind on the lotus feet of Kṛṣṇa (sa vai manaḥ kṛṣṇa-padāravindayoḥ) and in this way achieve the perfection of yoga. Otherwise, the flickering mind will hover on the platform of mental speculation for sense enjoyment, and one will have to transmigrate from one type of body to another because the mind is trained only in relation to the material elements, or, in other words, to sense gratification, which is false. Māyā-sukhāya bharam udvahato vimūḍhān (Bhāg. 7.9.43). Rascals (vimūḍhān), being controlled by mental speculation, make huge arrangements by which to enjoy life temporarily, but they must give up the body at the time of death, when everything is taken away by Kṛṣṇa’s external energy (mṛtyuḥ sarva-haraś cāham). At that time, whatever one has created in this life is lost, and one must automatically accept a new body by the force of material nature. In this life one may have constructed a very tall skyscraper, but in the next life, because of one’s mentality, one may have to accept a body like that of a cat, a dog, a tree or perhaps a demigod. Thus the body is offered by the laws of material nature. Kāraṇaṁ guṇa-saṅgo ’sya sad-asad-yoni janmasu (Bg. 13.22). The spirit soul takes birth in higher and lower species of life only because of his association with the three qualities of material nature.

ūrdhvaṁ gacchanti sattva-sthā
 madhye tiṣṭhanti rājasāḥ
jaghanya-guṇa-vṛtti-sthā
 adho gacchanti tāmasāḥ

“Those situated in the mode of goodness gradually go upward to the higher planets; those in the mode of passion live on the earthly planets; and those in the mode of ignorance go down to the hellish worlds.” (Bg. 14.18)

In conclusion, the Kṛṣṇa consciousness movement offers the topmost welfare activity for human society. The saner section of human society must therefore take this movement very seriously for the benefit of all humanity. To save oneself from the repetition of birth and death, one must purify his consciousness. Sarvopādhi-vinirmuktaṁ tat-paratvena nirmalam. One must be freed from all designations — “I am American,” “I am Indian,” “I am this,” “I am that” — and come to the platform of understanding that Kṛṣṇa is the original master and we are His eternal servants. When the senses are purified and engaged in Kṛṣṇa’s service, one achieves the highest perfection. Hṛṣīkeṇa hṛṣīkeśa-sevanaṁ bhaktir ucyate. The Kṛṣṇa consciousness movement is a movement of bhakti-yoga. Vairāgya-vidyā-nija-bhakti-yoga. By following the principles of this movement, one becomes disassociated from material mental concoctions and is established on the original platform of the eternal relationship between the living entity and the Supreme Personality of Godhead as servant and master. This, in summary, is the purpose of the Kṛṣṇa consciousness movement.