The roots of the so-called prosperity gospel lie in the biblical theology of retribution, found in many parts of the Hebrew scriptures (but interestingly challenged in both Job and Qoheleth), according to which faithfulness will be rewarded while infidelity will be punished. 
One of the most often quoted texts is that of Dt 30, where Moses is portrayed as saying to the Hebrews as they were about to enter the Promised Land "I set before you life and death, the blessing and the curse...." This same idea worked its way into Calvinist thought and found expression in, for example, the famous speech to the settlers bound for the new world in 1630 "A Modell of Christian Charity" and has remained part of many congregational churches -- resurrected by radio and TV evangelists who depend on gifts for their living. In their proclamation, however, "fidelity" to the Lord" is replaced by "show your faith by giving and you will be rewarded." In its most extreme expression, it is self-worship.