If one distances himself from another Muslim because of his bad conduct, does one incur a sin?

If you boycott someone because of his Islamically unacceptable behavior, you are to be commended. It is always better to steer away from whatever and whoever encourages sinful practice.