God can heal any person of any condition at any time. Absolutely anything is possible with God, as Jesus said.
Why does God (Love) not perfectly heal everyone, giving the great gift of a perfect bodymind to all His/Her children?
This is possible, but God allows the inconvenience and even suffering of illness in order for us to learn compassion through empathy. A person who has never suffered would feel no compassion towards others who suffer. But she who suffers much, loves much.
Imperfect health is the essence of our spiritual training in Love.
Illness also makes us humble, realizing that we cannot control everything with the conscious mind. The tendency towards "magical thinking' is so attractive, so tempting, that God often allows us to experience illness in order that we can realize our full and complete dependence on Love (God).
Added to the above is our karmic heritage. If ever, in our long history, we have harmed another with deliberate intention, our body might reflect the same or similar condition. But even if this might be so, it does nothing to neutralize or dilute our real need to show compassionate Love towards all. Also, some suffering is the result of voluntary or elective karma; it was chosen by a Soul to accelerate spiritual development.
Also, remember that illness is not "totally bad," for it can provide us with opportunities for exits from these bodies.
But this is by no means the most common explanation. A fourth reason for illness is that it teaches us precisely what we need to learn. Most of the great and lovely saintmystics and mastersages of history have suffered from some biological shortcomings. These could turn their attention away from the glittering baubles of the external world, turning their gaze inward.
At any rate, we know that illness is not the result of a "curse" by God, but is instead an evidence of His special blessing. St. Paul had eye-trouble, about which he prayed many times. God apparently did not heal him, but told him, "My strength shall be complete in thy weakness."
These "weaknesses" remind us continually not to depend upon the ego, but upon only infinite Love (God). They slam the interior brakes on ultraegotism and egocentricity. For only when humbled from the illusion of selfimportance does a heart turn towards Love.