Why do Catholics believe there is any merit in suffering? Isn't suffering just a punishment? If you have suffering doesn't it mean you lack faith? What is the meaning of suffering?
St. Augustine's view of suffering seems to be the one adopted by the Church early on, and one of the things that Christians struggle with today. The Catholic understanding is that suffering merits good for our souls and can be a witness to others.
However, it often happens that God shows more clearly His manner of working in the distribution of good and bad fortune. For if punishment were obviously inflicted on every wrongdoing in this life, it would be supposed that nothing was reserved for the last judgement; on the other hand, if God's power never openly punished any sin in this world, there would be an end to belief in providence. Similarly in respect to good fortune; if God did not grant it to some petitioners with manifest generosity, we should not suppose that these temporal blessings were His concern, while if He bestowed prosperity on all just for the sake of those rewards, and any service of Him would prove us not godly but rather greedy and covetous.
This being so, when the good and the wicked suffer alike, the identity of their suffering does not mean that there is no difference between them. Though the sufferings are the same, the sufferers remain different. Virtue and vice are not the same, even if they undergo the same torment. The fire which makes gold shine makes chaff smoke; the same flail breaks up the straw, and clears the grain; and oil is not mistaken for lees because both are forced out by the same press. In the same way, the violence which assails good men to test them, to cleanse, and purify them, effects in the wicked their condemnation, ruin, and annihilation. Thus the wicked, under pressure of affliction, execrate God and blaspheme; the good, in the same affliction, offer up prayers and praises. This shows that what matters is the nature of the sufferer, not the nature of the sufferings. Stir a cesspit, and a foul stench arises; stir a perfume, and a delightful fragrance ascends. But the movement is identical.
[St. Augustine, "City of God", Book 1, "chapter" 8]
Suffering is not necessarily a punishment. Fortune and fame not necessarily a reward. What matters is what is inside. Sometimes God tests, sometimes punishes, and sometimes allows "bad things to happen to good people" because He gave man free will, some choosing to do evil. Christians should "offer up prayers and praises" through it all and hope for the reward that is our future home.