The teachings about lawful earnings and love of the world are not contradictory. One concerns meeting permissible needs and responsibilities; the other warns against desire that prompts wrongdoing.
1. Earning honestly to support dependants can be a duty.
2. Lying, cheating, or violating rights to obtain the same income is blameworthy.
3. Possessing wealth is not itself a sin; how it is gained and used matters.
Grammatically حُبُّ الدُّنْيَا is the nominal subject, and رَأْسُ كُلِّ خَطِيئَةٍ is its predicate. The image of a “root” is developed through the iḍāfah expression.