I have read that the caste system started out as a way of explaining duty. The duties of a priest are different from those of a merchant, etc. But then it became too strictly adhered to and Brahmins became an "elite" class that owned a lot of land and wealth, and they began oppressing the shudras.
I've often wondered if the caste system was really such a bad thing. Every society automatically has a class system of some sort - today it is based mostly on wealth since we live in an increasingly global capitalist society, in other societies it can be based on power, birth, race, or whatever. Are any of these good? If the caste system was not bound strictly to birth, it might not be such a bad idea, since it would lay out the duties of every man's profession and a man who is simply a great craftsman and didn't have time to devote his full energy to religion would know what to do in that situation, and so on. I don't think it matters today though, since a capitalist society will always base its classes on wealth.