The precept of detachment from riches is obligatory for entrance into the Kingdom of heaven. (CCC §2544)
I find that trials are a great help towards detachment from the things of earth: they make one look higher than this world. Nothing here can satisfy, and we can find rest only in holding ourselves ready to do God’s will. [St. Thérèse of Lisieux, Story of a Soul, p. 284]
You cannot serve God and mammon, but excessive attachment to any worldly goods is hazardous to your soul.