"Can two walk together, except they be agreed?" (Amos 3:3)
"Neither be partaker of other men's sins: keep thyself pure" (1 Timothy 5:22)
The doctrine of fellowship commences in the Old Testament with the separation of Cain, who slew his brother, from his parents and the rest of their progeny. Abraham was told to come out of Ur of the Chaldees, and he and his descendants were told to become "strangers and pilgrims on the earth" (Heb 11:13Heb 11:13 These all died in faith, not having received the promises, but having seen them afar off, and were persuaded of them, and embraced them, and confessed that they were strangers and pilgrims on the earth.). Not only is the doctrine of fellowship the sharing of something by a group of people, but it is a doctrine of exclusion of those who do not share that same something.
Israel, (Yahweh's ecclesia in the Old Testament), were commanded to eradicate the inhabitants of Canaan and not to make marriages with them. The reason being, ...it will work like leaven to corrupt the whole."For they will turn away thy son from following me, that they may serve other gods: so will the anger of the LORD be kindled against you, and destroy thee suddenly" (Deut 7:4). Yahweh knew that where sin is allowed to remain within a community, it will work like leaven to corrupt the whole. This was the case when "the sons of God saw the daughters of men that they were fair; and they took them wives of all which they chose", and it has ever been so. This is why children of Belial (wickedness) were to be put to death, as were adulterers, "so shall thou put away evil from Israel" (Deut 22:22).
There is no doubt that we are called to separation from evil. Yahweh said to Israel, "Ye shall be holy: for I the LORD your God am holy" (Lev 19:2). The word holy is translated from the Hebrew qadosh which means to be separate, or set apart.Fellowship...is just as importantly an isolating of a group of people When Nadab and Abihu transgressed Yahweh said "I will be sanctified in them that come nigh me, and before all the people I will be glorified" (Lev 10:3). Again, the word sanctified comes from the same Hebrew word qadosh, meaning to be separate, or set apart. Just as Yahweh set Israel apart from the other nations, and they were commanded to set themselves apart by living lives acceptable to Yahweh, so we are commanded to set ourselves apart from the world and its evil practices. "But ye are a chosen generation, a royal priesthood, an holy nation, a peculiar people; that ye should shew forth the praises of him who hath called you out of darkness into his marvellous light" (1 Pet 2:9). The same command is given to us, "But as he which hath called you is holy, so be ye holy in all manner of conversation; Because it is written, Be ye holy; for I am holy" (1 Pet 1:15 & 16). So fellowship is not only a coming together of people into one body — it is just as importantly an isolating of a group of people from those who do not share their beliefs and aspirations. As we would expect, the Spirit through the Apostle Paul puts it perfectly, "Be ye not unequally yoked together with unbelievers: for what fellowship hath righteousness with unrighteousness? and what communion hath light with darkness?" (2 Cor 6:14).
Jacob was told that he would be fruitful and would become a "multitude of people" (Gen 28:3Gen 28:3 And God Almighty bless thee, and make thee fruitful, and multiply thee, that thou mayest be a multitude of people;). The word multitude is from the Hebrew qahal meaning an assembly called together. Stephen, in his defence before the Sanhedrin, calls the generation of Israel which came out of Egypt "the ecclesia in the wilderness" (Acts 7:38Acts 7:38 This is he, that was in the church in the wilderness with the angel which spake to him in the mount Sina, and with our fathers: who received the lively oracles to give unto us:). Just as Israel were "called out" of physical Egypt to be an ecclesia, so we are an ecclesia, and have been called out of spiritual Egypt. But just as there were false prophets among Yahweh's Old testament ecclesia, so there have arisen false teachers among the ecclesia of today (2 Pet 2:12 Pet 2:1 But there were false prophets also among the people, even as there shall be false teachers among you, who privily shall bring in damnable heresies, even denying the Lord that bought them, and bring upon themselves swift destruction.).