“It is written, Be ye holy; for I am holy.” (1 Peter 1:16, quoting Lev 11:44-45)
Peter wrote this to reiterate a principle laid down in the Law of Moses. Our holiness, or attempts thereto, are a direct result of God’s holiness.
Some people misquote the verse, saying, “Be ye holy, as I am holy.” There is a big difference between “as” and “for.” To be holy, as God is holy, is an impossible task. God created man with the ability to make choices. Along with that ability comes the ability to sin. Perhaps we even have a propensity to sin, since none of us has ever been able to live free of sin, except Jesus. God’s holiness is intrinsic. It is built into his nature. He cannot be anything but holy and remain God. Therefore, it is impossible for us to be holy in the same way that (as) God is holy. Even in the best of our holiness we may not do what we want to do. (Rom 7) We cannot be as holy as God. We can be, and Christians are, holy because God has given us his holiness. He has wiped our unholiness clean, and continues to do that. Nevertheless, we still are not holy, as he is holy.
What the verses in Leviticus and 1 Peter say, however, is that we are to be holy for/because God is holy. One might say this holiness is on two levels. We have the holiness he gives us because of forgiveness of sin through the Christ. Then we have our own attempts at holiness because we want to do our best to be like God. Because we are dead to sin, we work at holiness. (Rom 6) Even so, we cannot attain any personal holiness by ourselves, even after our death, burial, and resurrection. We are people, and we live with people.
God's holiness is not affected by his living among his people. He is so holy as not to be affected living among sinners. The glory of God dwelt in the Tabernacle, and the Temple. Did that make the people holy? No. Did that make God unholy? Not at all.
We on the other hand must avoid living among sinners because we don't have that kind of holiness. When Peter quoted the passage in Leviticus, it was in the context of changing one’s life away from the former lusts. Later Peter says that this involved leaving former acquaintances.
For the time past of our life may suffice us to have wrought the will of the Gentiles, when we walked in lasciviousness, lusts, excess of wine, revellings, banquetings, and abominable idolatries: Wherein they think it strange that ye run not with them to the same excess of riot, speaking evil of you. (1 Pet 4:3-4)
Paul said, “Do not be deceived, “Bad company corrupts good morals.” (1 Cor 15:33) He did not say it was only a possibility; he said not to be deceived into thinking it was not a possibility. Because we live among people, we cannot maintain perfect holiness. We can, however, do our part to purge out the leaven of sin when it comes among us in the church.
I wrote unto you in an epistle not to company with fornicators: Yet not altogether with the fornicators of this world, or with the covetous, or extortioners, or with idolaters; for then must ye needs go out of the world. 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. (1 Cor 5:9-13)
We can be holy, not just have holiness imputed to us. It must be possible, because God commands it. We will not be perfect in it, but we must try. Why? God gave the reason. “Be ye holy, for I am holy.” We maintain what holiness we can because we want to be like God. We were made in his image, and we want to continue in his image. Because God is love, we love. Because God is forgiving, we forgive. Because God is holy, we maintain our holiness.