Question: Some think one should suffer to develop compassion for others, but isn't it better to learn to avoid pain through wisdom and foresight?
Answer: Oh absolutely! There's plenty of suffering to go around - no need to artificially manufacture any. But suffering can not be avoided in the long run. The practice of compassion does not end suffering, it transforms the way we relate to suffering and the power that we give it.
Every instance of the word should could be hash tagged with #suffering. Every one. Ditto with the words "avoid", "must", "better" and all of the countless linguistic markers that claim things are not ok as they are. The idea that suffering is wrong, that this essay is about the questioner "getting it wrong" is recursively ripe with suffering.
Suffering comes from the words sub (to be under) and ferre (to carry), in other words, to suffer is to be oppressed by what we must carry. What we carry is our impermanent, imperfect human life accompanied by the ceaseless, often unconscious process of wishing things were not as they are. This is true of enormous suffering - wishing we were not ill or that the one we love were still with us. This is true of background, subtle suffering - wishing we were wiser or happier or in any way better than we find ourselves - typically accompanied with the belief that were we thus improved our suffering would finally cease. As we struggle under what is, we throw coins into a fountain, wishing we were here and not there, there and not here, wishing we did not have what we have or that we would get what we don't have. Even when things are satisfactory for a moment we often find ourselves worrying that it won't last or struggling to extend that satisfaction.
Suffering is so ubiquitous that even this question is marinating in it. The main difference between suffering and it's opposite, equanimity, is not that equanimity feels good, it's that equanimity doesn't struggle against the current situation regardless of how it feels.
In my experience true equanimity is fleeting and has typically been in the wake of great pain (your results may vary). In this state, there is a astonishing expansiveness, the walls feel blown out, everything is brighter and sweeter and exactly as it is without preference. This is equanimity.
Cultivating wisdom and foresight for the purpose of trying to avoid suffering - is suffering. Cultivating spirituality, cultivating equanimity, doing good, or any other trait for the purpose of trying to avoid suffering - is suffering. What we grow in a garden of avoidance is usually the near enemy of equanimity: indifference.
The trouble with indifference is that it is pseudo-equanimity. It helps us to insulate use from what we carry so our suffering is less obvious to us. If equanimity is surfing the big waves, indifference is the refusal to enter the sea. Most people I meet are half out of the water.
The good and bad news is that indifference is only a temporary fix. Indifference is the opposite of vividness, engagement and life - the very things we are drawn toward when we are well. People sustain their indifference by anger, fear or some other form of addiction. When Leonard Cohen, who know something of these affairs, wrote "Every heart to love will come, but like a refugee" he was saying that eventually - it can take a really long time - but eventually, people who have become stuck in indifference become thirsty for life again.
So, sure, avoid suffering if you can, if you wish. But the path you suggest in your question will lead to compassion sooner of later.