You have some good answers here. These passages do not address the cause of suffering other than we cannot blame suffering directly on the one who is suffering. Note the book of Job. That was a way of justifying ignoring one's responsibility to help those suffering. Consider the parable of the Good Samaritan.
In the first passage is:
... but that the works of God might be displayed in him.
(John 9:3b, ESV)
Your question confuses the reason for suffering with the cause of suffering. The reason is why it is allowed, not what causes it.
We must work the works of him who sent me ...
(John 9:4a, ESV)
This was not an isolated incident, but an indication of our responsibility. While God still sometimes performs miracles for a particular purpose, this is not limited to that.
If suffering and illness is caused by a person's sin, why would you work on developing cures? Why would doctors work to heal the sick? Why would first responders spend their time and even risk their lives to help those in trouble?
The fact is suffering exists as a opportunity for love.
“For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him.
(John 3:16–17, ESV)
The purpose of all creation is to express and respect who God is:
The heavens declare the glory of God,
the sky proclaims His handiwork.
Day to day makes utterance,
night to night speaks out.
There is no utterance,
there are no words,
whose sound goes unheard.
Their voice carries throughout the earth,
their words to the end of the world.
(Psalm 19:2–5, JPS1985)
Let all that breathes praise the LORD.
Hallelujah.
(Psalm 150:6, JPS1985)
Thus, God expects our response to suffering to be to show his love.
A new commandment I give to you, that you love one another: just as I have loved you, you also are to love one another. By this all people will know that you are my disciples, if you have love for one another.”
(John 13:34–35, ESV)
But I say to you, Love your enemies and pray for those who persecute you, so that you may be sons of your Father who is in heaven. For he makes his sun rise on the evil and on the good, and sends rain on the just and on the unjust.
(Matt. 5:44–45, ESV)
Thus said the LORD:
Let not the wise man glory in his wisdom;
Let not the strong man glory in his strength;
Let not the rich man glory in his riches.
But only in this should one glory:
In his earnest devotion to Me.
For I the LORD act with kindness,
Justice, and equity in the world;
For in these I delight
—declares the LORD
(Jer. 9:22–23, JPS1985)