If one is at rock bottom then working hard and being productive can get them to middle class lifestyle. It works. Helped billions of people in the past few decades.
But starting from middle class and working hard won't make riches. Think of it physically. A hardworking person can build a house compared to a drunkard who will be homeless. Yet the same hard working person can't build million houses and get insanely wealthy.
To get truly materially rich (millions+ usd, servants, yachts, etc) one usually needs to be evil and screw over other people. Productivity, in the sense of a machine making houses in the millions, would make the inventor fairly rich. But this is the exception rather than the rule. Most riches are arrived at immorally as parent comment mentions.