Would you baptize an individual who you think is still living in sin or setting a bad example? For instance, if the individual is living with a girlfriend but claims that they do not have sex and sleep in different rooms.
"Let no one despise your youth, but be an example to the believers in word, in conduct, in love, in spirit, in faith, in purity" (I Timothy 4:12).
While the individual claims that they are sleeping in separate rooms, the fact remains that no one knows that this is actually taking place. All his neighbors and friends will simply assume that they are having sex because that is what worldly people do in such a situation. It is what he would assume if he saw another couple living together.
In becoming a Christian, a person is declaring that Christ is his Lord and Master. That declaration is not just to God, it is a bold declaration to the entire world. "Therefore whoever confesses Me before men, him I will also confess before My Father who is in heaven" (Matthew 10:32). Such a confession is ruined if our example contradicts what the Lord teaches or encourages others to engage in practices that are against the Lord's will. This was one of the faults of the Jews. "And do you think this, O man, you who judge those practicing such things, and doing the same, that you will escape the judgment of God" (Romans 2:3).
I would have a serious discussion with both the man and his girlfriend about the commitment being entered into. No one is perfect, especially those new to Christ, but when something is clearly wrong or would be naturally seen as wrong, then the best thing is to fix the problem first. Encourage them to separate until they can get married. If there is no place else to live, offer one of them a room.
Baptism is about freedom from sin. "What shall we say then? Shall we continue in sin that grace may abound? Certainly not! How shall we who died to sin live any longer in it? Or do you not know that as many of us as were baptized into Christ Jesus were baptized into His death? Therefore we were buried with Him through baptism into death, that just as Christ was raised from the dead by the glory of the Father, even so we also should walk in newness of life. For if we have been united together in the likeness of His death, certainly we also shall be in the likeness of His resurrection, knowing this, that our old man was crucified with Him, that the body of sin might be done away with, that we should no longer be slaves of sin. For he who has died has been freed from sin" (Romans 6:1-7). That change starts now.
A person who knows he needs to be baptized but doesn't realize he is sinning is only half-taught. After Peter spoke of the need to repent and be baptized, we find him continuing to teach. "And with many other words he testified and exhorted them, saying, "Be saved from this perverse generation"" (Acts 2:40).