You see, in olden times in India (I am talking of middle ages), very few people were rich, but even the poor people had enough for their needs. Most villages were self-sufficient and there needs were few. The rich included some, and not all, of the warrior caste (kings and their relatives) and some traders. So, it was not a question of getting more riches. It was more about being satisfied with what came to one as his traditional profession. There was not much education around except brahmins learning Sanskrit and memorizing scriptures, which was the task given to them by the society. Even kings till late did not have any education and used seals to indicate their consent. A Jodhpur king (I am from that place) used to put his seal saying 'Sahi chhe' ('it is correct', rather than signing an order). That was what caste meant to us, and the teaching was that even if one was born as a 'shudra', one need not dispair. Performing his duties, even a shudra could attain nirvana and union with God. We have hundreds of Saints who belonged to the 'shudra' castes (including the most important of them, Sage Vedavyasa, who practically wrote all scriptures of Hinduism - compiled the four Vedas, wrote Brahmasutras, Mahabharata, and eighteen Puranas including SrimadBhagawatham).