Mesora: Pirkei Avos 1:2 (Ethic of the Fathers) says, the world was created for 3 things, 1) Torah, 2) Avoda (Prayer according to Maimonides), 3) Acts of kindness, under which visiting the sick is categorized.
What is it about these three things that God determined without them, the world would be without purpose?
1) Torah is of course the area of activity which is the most beneficial to man. It teaches him what is real - i.e., what is true, and what is not. It teaches man concepts without which, his existence as man is not realized and his life would be a complete waste. It is the one activity which surpasses all others as it provides man with the happiest state he can achieve. That state of perceiving his Creator in as much as each member can.
2) Prayer according to Maimonides is in place of the sacrifices which one used to bring to atone for sins committed.
3) Acts of kindness is mentioned according to Rashi, as it spans a wider audience, wider than charity which can only be performed for the poor. Acts of kindness according to Rashi includes both rich and poor, dead and living, and may be performed with money or with oneself.
The question is, why this group is limited to only these three.
I believe the answer is because Torah represents the one positive involvement par excellence - the involvement in the greatest good. Prayer is the removal of the evil characteristics, removal of the bad. But these first two deal with ourselves, independent of others. Acts of kindness are to display that the first two goals, Torah and Prayer, are so important that we wish to create a situation where others besides ourselves may engage in them. It demonstrates an objectivity about our very existence, that we see others as entitled to Torah and Prayer as we are.
Therefore, visiting the sick is an act which displays that we view others as important as ourselves. It is the act which represents a perfected person's objective desire to show a less fortunate person that although he is healthy, he recognizes that he is no more entitled to life than the sick person.