Max Weber's main thesis in "Asceticism and the Spirit of Capitalism " (chapter 5 of "The Protestant Ethic and the Spirit of Capitalism") is that the meaning imposed my people and cultures on their beliefs and values has great influence on the manner in which they perceive their reality and act within it. Weber demonstrates his thesis on the case of the ascetic Protestants, especially Calvinistic ones, in order to show how their behavior is the result of a religious ideology which they took upon themselves and which directed they're daily activities.
Weber does not deny Marx's material explanations of history, but he does feel that they are a bit one-sided and one-dimensional. Weber would like to add that beyond means and relations of production and so forth there are cultural and religious factors which hold great weight in shaping social life.
According to Weber, Calvinistic principles emphasized work as an ascetic mean to avoid temptation and as the purpose of human existence. Work was for them a moral issue, a divine decree which is imposed on all, rich and poor. Accordingly, the division of labor was perceived as part of the divine program on earth and therefore fulfilling one's part in it was doing god's biding. According to the Protestant ethic you were supposed to play your assigned role in life in order to do your part for the common good. This means two things that are very important for capitalism: 1. There more important and significant your job is the more god likes you. 2. The better you are at your job the better you are as a person. Both these implications can be measure in financial terms: if you have money – it means that you are a good person.
Profit and wealth are thus perceived by the Protestant ethic as a sign of god's grace. Prosperity is an indication that you are on god's good side and that you will be redeemed in the afterlife. Furthermore, wealth is good and justified if it is used for generating more wealth, and not for idle hedonistic enjoyments. This is of course also very important for capitalism, as Weber notes.
According to Weber the ascetic ideology denounces luxury and ostentatious wealth and opposes unfairness and greed. This approach relates negatively to both feudal nobility and beggars which live at the expense of others. The ascetic ideology according to Weber is favorable towards the hard working, law abiding rational bourgeois that accumulate wealth through diligences and frugality. Leisure is only tolerable in the eyes of the ascetic ethic, and it is allowed only as long as it does not lead to indulgence or empty enjoyment.
For Weber, capitalism is the ascetic spirit stripped from its religious origins. The protestant decree of behaving according to one's business interests as a form of reverence aided in legitimizing capitalistic inequality. The bourgeois rich can now enjoy both worlds: material gains and moral virtue.