Numbers 5:2 Command the children of Israel, that they put out of the camp every leper, and every one that hath an issue, and whosoever is defiled by the dead: 3 Both male and female shall ye put out, without the camp shall ye put them; that they defile not their camps, in the midst whereof I dwell.
When a person got sick with a contagious disease they were to be put out of the camp. The reason was to keep the rest of the camp healthy. If you allow sickness in the camp you may see it spread.
The lesson here is a positive one. We separate to not be contaminated. The separation is from the sin, the action and not so much the person. We can love people while not loving their sin.