1 Corinthians 5:11-13:

But now I have written unto you not to keep company, if any man that is called a brother be a fornicator, or covetous, or an idolater, or a railer, or a drunkard, or an extortioner; with such an one no not to eat.
For what have I to do to judge them also that are without? do not ye judge them that are within?
But them that are without God judgeth. Therefore put away from among yourselves that wicked person.

See also:

Who or What Causes Sickness?
Sickness as Chastening and Judgment in the New Testament
Objection: Teaching Grace Gives People a License to Sin
Objection: James’s Command About What to Do with the Sick Proves That We CAN Get Sick